mbinge / gomock

Automatically exported from code.google.com/p/gomock
Apache License 2.0
0 stars 0 forks source link

Consult $GOPATH for auxilliary interface definitions #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, it is necessary to manually specify all dependencies when running 
mockgen on a file. For example, running `mockgen --source=temp.go` on the 
attached file produces the following error:
2011/10/11 02:40:03 Don't have any auxilliary interfaces for package "os"

It would be nice if it could check $GOPATH (or at least $GOROOT/src) for the 
interfaces.

Original issue reported on code.google.com by awre...@gmail.com on 11 Oct 2011 at 6:42

Attachments:

GoogleCodeExporter commented 9 years ago
It's a reasonable request, but not crucial (you can use -aux_files to point at 
$GOROOT/src/pkg/os/error.go). My concern would be that Go developers 
increasingly won't have a $GOROOT at all. The better long-term solution will be 
to get the type definitions from the .a files, but that depends on the go/types 
package being fleshed out.

Original comment by dsymo...@golang.org on 11 Oct 2011 at 10:36

GoogleCodeExporter commented 9 years ago
The GOPATH is different from the GOROOT: the GOPATH is used by goinstall to 
provide a list of directories where go files may be found. (See "The GOPATH 
Environment Variable" here http://golang.org/cmd/goinstall/)

Original comment by awre...@gmail.com on 31 Oct 2011 at 9:47

GoogleCodeExporter commented 9 years ago
This is obsolete. The source mode of mockgen is deprecated and will be removed 
entirely soon, and this issue is not a problem for the reflect mode.

Original comment by dsymo...@golang.org on 5 Sep 2012 at 7:46