Skip to content

x/pkgsite: Tutorial should tell you to start in $GOPATH #60035

@GitMazzone

Description

@GitMazzone

What is the URL of the page with the issue?

https://go.dev/doc/tutorial/create-module

Description

I'm brand new to Go and am following along with the tutorial.
The tutorial doesn't make any mention by this point (creating a module) of $GOPATH or $GOROOT, which I've learned is where these examples really need to live so that each module can resolve without needing to symlink to somewhere else on my system.
Without this information, and having created the tutorial code exactly as instructed, it leads to errors not being able to find modules where it looks by default, $GOPATH and $GOROOT.

This is the current tutorial instruction for where to create code:

It should tell us to create a user/go/src/example/hello dir, no? This way in the next steps we're able to create a src/greetings dir.

Have I overlooked something, or is this information that should be included in the documentation?
Seems fixable with a brief addition about where to create the tutorial work (and all future work, according to the opinions of some, though I'm not sure on common practices here). In the $GOPATH.

I'm happy to open a PR adding that to the docs if I am understanding this correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.pkgsite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions