Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
526 B

  1. package main
  2. import "fmt"
  3. func main() {
  4. logLevel := "デバッグ"
  5. // For a string value, the range clause iterates over the
  6. // Unicode code points in the string starting at byte index 0.
  7. // On successive iterations, the index value will be the index
  8. // of the first byte of successive UTF-8-encoded code points
  9. // in the string, and the second value, of type rune,
  10. // will be the value of the corresponding code point.
  11. for index, runeVal := range logLevel {
  12. fmt.Println(index, string(runeVal))
  13. }
  14. }