github.com/spotify/syslog-redirector-golang@v0.0.0-20140320174030-4859f03d829a/blog/content/strings/range.go (about)

     1  // Copyright 2013 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import "fmt"
     8  
     9  func main() {
    10  	const nihongo = "日本語"
    11  	for index, runeValue := range nihongo {
    12  		fmt.Printf("%#U starts at byte position %d\n", runeValue, index)
    13  	}
    14  }