Last active
October 16, 2019 17:25
-
-
Save parvezmrobin/0b4fd68aaf4167a2181dd4c94f9c4edc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
var s = []int{1, 2, 3, 4} | |
println(s[0], s[1], s[2], s[3]) // 1 2 3 4 | |
s = append(s, 13) | |
println(s[4], len(s), cap(s)) // 13 5 8 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment