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
proposal: cmd/go: Add a go new command to alleviate new user confusion #16383
Comments
What does a new user do if they do not have a github account?
or something along those lines. Maybe if you run Go without a GOPATH (or an inferrable GOPATH) it just suggests all the defaults in one go. Look in the home directory for .git* and .hg*, and work from there. |
This is a nice idea to help people familiarize with the project, but it goes so far out of what the Also, this might sound like nitpicking, but I mention it to illustrate the issues with the approach: in your example you show the current working directory changing from |
@dr2chase Should probably make it more clear the url just is a namespace, but typically is some version control service, like github or bitbucket. If we wanted to sniff git username, that may be difficult for those of us who do not use github because while @mem On windows we could use a wrapper batch script and call the command Additionally I do agree it is somewhat out of scope for the |
I think we have different ideas of "new" user. I imagine people who would give you a blank look if you said "git" or "namespace". It's hard for me to imagine someone adequately competent at Git (i.e., more competent than I am) who would have difficulty getting started with Go. |
@dr2chase Perhaps word it more like:
Enter a package name. This typically begins looks like [
github.com/user/project] or simply [user/project] if you don't want to
publish your code.
|
@adg, thoughts on this? It's similar to your "workspace" idea. |
It is indeed similar to my go workbench idea. |
I think #17262 will probably make this less important. But it's a significant problem to solve, and there are many ways of looking at it. |
So it seems too early and maybe too much or too little. I think we need more information to make this more concrete. Possible paths forward:
|
As #12488 mentions new users often have trouble understanding what the
GOPATH
environment variable is for, how to set it up, and how to use it.To alleviate confusion I suggest we add a
go new
command. It would create a new project and serve as a introduction to new users. On first run it may look like:The tool would then create the $GOPATH structure, and add it to wherever you add $GOPATH on your os. It might also copy the default go playground example, or similar, to the new project directory and
cd
there. It could also, optionally, add$GOPATH/bin
to your $PATH, or at least give guidance on how go install works.Subsequent runs could just be:
I think this would help new users understand the gopath structure hands-on, and get them writing code as opposed to dealing with environment variables.
The text was updated successfully, but these errors were encountered: