wire/internal/wire: use on-disk GOPATH in generate tests (google/go-cloud#616)
The primary motivation is to permit a move to using go/packages instead of go/loader. go/packages runs exclusively by shelling out to the go tool, which precludes use of the in-memory "magic" GOPATH being used up to this point. This has a secondary effect of removing a lot of code to support "magic" GOPATH from the test infrastructure. This is on the whole good, but necessitated a change in the error scrubbing: since the filenames are no longer fixed, error scrubbing also must remove the leading $GOPATH/src lines. Another related change: since all callers of Generate needed to know the package path in order to write out wire_gen.go (necessitating a find-only import search) and Generate already has this information, Generate now returns this information to the caller. This should further reduce callers' coupling to Wire's load internals. It also eliminates code duplication. This should hopefully shake out any difference in path separators for running on Windows, but I have not tested that yet. Updates google/go-cloud#78 Updates google/go-cloud#323
This commit is contained in:
@@ -1 +1 @@
|
||||
/wire_gopath/src/example.com/foo/wire.go:x:y: string does not implement io.Reader
|
||||
example.com/foo/wire.go:x:y: string does not implement io.Reader
|
||||
Reference in New Issue
Block a user