Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckUnmarshalPointer / CheckUnmarshalPointer.go
1 package pkg
2
3 import "encoding/json"
4
5 func fn1(i3 interface{}) {
6         var v map[string]interface{}
7         var i1 interface{} = v
8         var i2 interface{} = &v
9         p := &v
10         json.Unmarshal([]byte(`{}`), v) // want `Unmarshal expects to unmarshal into a pointer`
11         json.Unmarshal([]byte(`{}`), &v)
12         json.Unmarshal([]byte(`{}`), i1) // want `Unmarshal expects to unmarshal into a pointer`
13         json.Unmarshal([]byte(`{}`), i2)
14         json.Unmarshal([]byte(`{}`), i3)
15         json.Unmarshal([]byte(`{}`), p)
16
17         json.NewDecoder(nil).Decode(v) // want `Decode expects to unmarshal into a pointer`
18 }