-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go,doc: module and documentation on "/doc/code.html" #31840
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
https://golang.org/doc/code.html has not yet been updated for modules. (See #28215; if you are looking for an introduction to modules, you can see https://blog.golang.org/using-go-modules for example). Is the suggestion here that you would like (Note that I think |
On Mon, 6 May 2019, 06:08 thepudds, ***@***.***> wrote:
https://golang.org/doc/code.html has not yet been updated for modules.
(See #28215 <#28215>; if you are
looking for an introduction to modules, you can see
https://blog.golang.org/using-go-modules for example).
Is the suggestion here that you would like 'go mod init' to be optional
before doing something like go install?
Yes.
After reading issue 28215 and my report again, I think the issue here is
that the latest Go require module in user's package directory even if
GOPATH is set by user; it should not.
IMO, module should not enforced to user when the following conditions met,
* user set GOPATH, or
* current package name is "main", or
* current package is located under "$HOME/go"
What I means by "current package" is either current directory or package
path passed when user running "go install/build/run".
Does that make sense?
|
#31857 proposes to move the default back to That would get you the desired behavior when |
A heuristic based on whether the current package name is
|
Duplicate of #31857 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Following the instruction on https://golang.org/doc/code.html from the beginning until "Your first program", the
go install
command on both examples will fail. Here is the log from beginning to the end,What did you expect to see?
Both
go install
commands, using import path and when running inside package directory, fail to run.What did you see instead?
Both
go install
commands should successfully running without error.Notes
I am not sure if this documentation or module issue, but I am prefer, if its possible, that the Go module is not aggressive as it is now. I have try to discuss this on golang-nuts [1] with one suggestion to raise this as an issue.
[1] https://groups.google.com/forum/#!topic/golang-nuts/48ASOqXkwa8
The text was updated successfully, but these errors were encountered: