Slices / Create a slice / Essential Go

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "fmt" ) func main() { var nilSlice []bool empty1 := []bool{} empty2 := make([]bool, 0) fmt.Printf("nilSlice is %#v\n", nilSlice) // empty slice is different than nil slice fmt.Printf("empty1 is %#v\n", empty1) fmt.Printf("empty2 is %#v\n", empty2) }
Editor Settings
Theme
Key bindings
Full width
Lines