.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / testdata / src / CheckTypedNilInterface / i35217 / 35217.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckTypedNilInterface/i35217/35217.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckTypedNilInterface/i35217/35217.go
new file mode 100644 (file)
index 0000000..c05b7e7
--- /dev/null
@@ -0,0 +1,24 @@
+package main
+
+import (
+       "errors"
+       "fmt"
+)
+
+type someError struct {
+       Msg string
+}
+
+func (e *someError) Error() string {
+       return "someError: " + e.Msg
+}
+
+func calculate() (int, *someError) {
+       return 42, nil
+}
+
+func main() {
+       err := errors.New("ERROR")
+       num, err := calculate()
+       fmt.Println(num, err, err == nil) // want `this comparison is never true`
+}