.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
1 package main
2
3 import (
4         "errors"
5         "fmt"
6 )
7
8 type someError struct {
9         Msg string
10 }
11
12 func (e *someError) Error() string {
13         return "someError: " + e.Msg
14 }
15
16 func calculate() (int, *someError) {
17         return 42, nil
18 }
19
20 func main() {
21         err := errors.New("ERROR")
22         num, err := calculate()
23         fmt.Println(num, err, err == nil) // want `this comparison is never true`
24 }