-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: report an error for cmd (and std?) modules outside $GOROOT #33138
Comments
Like @ianlancetaylor said in #32724, the current GOROOT and the toolchain's GOROOT are different. And it seems to always build the toolchain's GOROOT. You can do
The solution is to use the tip compiler itself to build cmd/doc. Instead of |
While building the toolchain (You should still use the matching toolchain because cmd/doc might not even build with older versions of Go.) /cc @bcmills @jayconrod |
I believe this is working as intended. Packages paths within the standard library and the It looks like you've checked out the Go repo to a directory separate from where the Go command is installed ( We should probably report an error for a module outside |
👍 |
Yes but if you have manually set GOROOT env in .bashrc to
👍 PS is cmd the only exception or are there other package names? |
|
If you create a Working in an alternate |
Working in an alternate |
Trying to work on the src code of
go doc
but every time I try to compile a./doc
binary it uses other src code, it doesn't look in the current directory am in, I have to force itgo build main.go
I can see a doc binary getting created but its not build form the
main.go
in current directory, I deliberately put a syntax error in main?details:
Workaround for me was match
GOROOT
with the repo as in,git clone
everything in/usr/local/go
and bootstrap using a/usr/local/go1
then I could work ongo doc
src code.maybe related to #32724
The text was updated successfully, but these errors were encountered: