Source file tour/moretypes/nil-slices.go

     1  //go:build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  func main() {
     8  	var s []int
     9  	fmt.Println(s, len(s), cap(s))
    10  	if s == nil {
    11  		fmt.Println("nil!")
    12  	}
    13  }
    14  

View as plain text