Skip to content

Instantly share code, notes, and snippets.

View Tochemey's full-sized avatar
:octocat:
Polyglot dev. Always looking for something to hack...

Arsene Tochemey

:octocat:
Polyglot dev. Always looking for something to hack...
View GitHub Profile
@Tochemey
Tochemey / main.go
Created December 26, 2021 18:52
golang slice internal behaviour
package main
import "fmt"
func main() {
// This demonstrates the internal of go slice and what happens when slice reaches its capacity and why to be careful when appending to slice
// define an array of 5 elements
arr := [...]int{1, 2, 3, 4, 5}
fmt.Println(arr) // [1 2 3 4 5]