Skip to content

Instantly share code, notes, and snippets.

@Adron
Last active May 20, 2019 01:02
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 Adron/aaa7d9de0921b728612b5eafb5d40890 to your computer and use it in GitHub Desktop.
Save Adron/aaa7d9de0921b728612b5eafb5d40890 to your computer and use it in GitHub Desktop.
the months
months := [...]string{1: "January", 2:"February", 3: "March", 4:"April", 12:"December"}
for _, s := range months {
fmt.Printf("The month: %s\n", s)
}
var runes []rune
for _, r := range "Language: 走" {
runes = append(runes, r)
}
fmt.Printf("%q \n", runes)
var x, y []int
for i := 0; i < 10; i++ {
y = appendInt(x, i)
fmt.Printf("%d cap=%d\t%v\n", i, cap(y), y)
x = y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment