go-tour/nil-slices.go

12 lines
147 B
Go
Raw Permalink Normal View History

2020-02-05 03:44:36 +00:00
package main
import "fmt"
func main() {
var s []int
fmt.Println(s, len(s), cap(s))
if s == nil {
fmt.Println("nil!")
}
}