Skip to content

Instantly share code, notes, and snippets.

@cecyc
Last active May 15, 2017 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecyc/440345082821e5f231c5ff1c6c3e416c to your computer and use it in GitHub Desktop.
Save cecyc/440345082821e5f231c5ff1c6c3e416c to your computer and use it in GitHub Desktop.
Print out runes in Golang (from Todd McLeod Golang training). Pretty neat for teaching unicode and special characters.
package main
import "fmt"
func main() {
for i := 0; i <= 500; i++ {
//Print the integer, the string of i (rune), and the bytes of i
fmt.Println(i, " - ", string(i), []byte(string(i)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment