-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: need to have the command to view the current path of one package information #23082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You mean this command?
|
Yes,but I got:
This can not solve my problem.I need to know which package I am using in the current directory or what the priority list is. |
Because that is not a Go package - it has no Go files. |
Yeah,I know it. But I think we can add such a feature, so that we can more clearly when we want to import a package. |
I think there's some level of confusion here. A directory under So, if you're asking for a command to print the directory where a Go package is, you want If you also want it to work for directories that have no Go files at all, I'm not sure what to answer. I cannot find any documentation explicitly mentioning it, but all tools seem to require at least one Go file in a directory for it to be a Go package. It sounds to me like you should rephrase your feature request to not mention "packages", unless you want to change the definition of what a package is too. |
@bradfitz Yes, your idea coincides with mine. I will close this issue. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/wgliang/Documents"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zd/20dl0mb523v4tjk_pf_hdscr0000gn/T/go-build387919256=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
I want to know the path of kubernetes I use where it is located by using the go which(or go path ...)github.com/kubernetes/kubernetes command. When my package is under more than one GOPATH or vendor, I do not know which package I use.
What did you expect to see?
Such as:
github.com/kubernetes/kubernetes:/Users/wgliang/Documents/src/github.com/kubernetes/kubernetes
What did you see instead?
No this function. And I wish to have this command.
The text was updated successfully, but these errors were encountered: