.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / testdata / src / CheckUnmarshalPointer / CheckUnmarshalPointer.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckUnmarshalPointer/CheckUnmarshalPointer.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckUnmarshalPointer/CheckUnmarshalPointer.go
new file mode 100644 (file)
index 0000000..862837a
--- /dev/null
@@ -0,0 +1,18 @@
+package pkg
+
+import "encoding/json"
+
+func fn1(i3 interface{}) {
+       var v map[string]interface{}
+       var i1 interface{} = v
+       var i2 interface{} = &v
+       p := &v
+       json.Unmarshal([]byte(`{}`), v) // want `Unmarshal expects to unmarshal into a pointer`
+       json.Unmarshal([]byte(`{}`), &v)
+       json.Unmarshal([]byte(`{}`), i1) // want `Unmarshal expects to unmarshal into a pointer`
+       json.Unmarshal([]byte(`{}`), i2)
+       json.Unmarshal([]byte(`{}`), i3)
+       json.Unmarshal([]byte(`{}`), p)
+
+       json.NewDecoder(nil).Decode(v) // want `Decode expects to unmarshal into a pointer`
+}