projects
/
dotfiles
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
.gitignore added
[dotfiles/.git]
/
.config
/
coc
/
extensions
/
coc-go-data
/
tools
/
pkg
/
mod
/
honnef.co
/
go
/
tools@v0.1.1
/
staticcheck
/
testdata
/
src
/
CheckTypedNilInterface
/
i31873
/
31873.go
1
package main
2
3
import "fmt"
4
5
type S struct{}
6
7
func (s *S) Error() string {
8
return "error for S"
9
}
10
11
func structNil() *S {
12
return nil
13
}
14
15
func errorNil() error {
16
return nil
17
}
18
19
func main() {
20
err := errorNil()
21
fmt.Println(err != nil)
22
err = structNil()
23
fmt.Println(err != nil) // want `this comparison is always true`
24
err = errorNil()
25
fmt.Println(err != nil)
26
}