gitee.com/mirrors/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/staticcheck/testdata/CheckNilMaps.go (about)

     1  package pkg
     2  
     3  func fn1() {
     4  	var m map[int]int
     5  	m[1] = 1 // MATCH /assignment to nil map/
     6  }
     7  
     8  func fn2(m map[int]int) {
     9  	m[1] = 1
    10  }