Skip to content

Instantly share code, notes, and snippets.

@lamarmarshall
Created October 26, 2017 00:23
Show Gist options
  • Save lamarmarshall/6c7a3ea777b9434859f618519dc28b64 to your computer and use it in GitHub Desktop.
Save lamarmarshall/6c7a3ea777b9434859f618519dc28b64 to your computer and use it in GitHub Desktop.
go slice append
package main
import "fmt"
func main() {
sls := make([]int, 0, 100)
sls = append(sls, 1, 2, 3, 4, 5)
fmt.Printf("type: %T capacity: %v\n values : %v", sls, cap(sls), sls)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment