You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
fset := token.NewFileSet()
src := `
package p
func f() int {
return 1
}
func g() {
defer f()
go f()
}
`
f, err := parser.ParseFile(fset, "", src, 0)
if err != nil {
t.Fatal(err)
}
var conf Config
types := make(map[ast.Expr]Type)
_, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Types: types})
if err != nil {
t.Error(err)
}
for x, typ := range types {
if exp, ok := x.(*ast.CallExpr); ok {
fmt.Printf("%+v, %v\n", exp, typ)
}
}
What is the expected output?
Two lines of output, one for the call expression corresponding to `defer f()` and one
for `go f()`.
What do you see instead?
No output.
Which version are you using? (run 'go version')
go version devel +2e735aa41d4a Tue Sep 17 13:30:36 2013 -0400 darwin/amd64
I'm trying to use this functionality for my program errcheck
(github.com/kisielk/errcheck) to check if someone ignored an error return by calling `go
f()` or `defer f()` where f() is a function that returns an error type.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: