Closed
Description
I'm having a problem using stringer with go generate. It reports errors because it can't find packages that I think it should be able to find. go build has no trouble finding them.
a.go, in directory $GOPATH/src/a:
package a
import "a/b"
type A int
const (
Aone A = 1
Atwo = 2
Athree = 3
)
//go:generate stringer -type=A
func a() {
b.B()
}
b.go, in directory $GOPATH/src/a/b:
package b
func B() {
}
In $GOPATH/src/a, this happens:
go generate
stringer: checking package: a.go:3:8: could not import a/b (can't find import: a/b)
a.go:13: running "stringer": exit status 1
Running go build instead of go generate works fine.