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

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