Skip to content

x/website/_content/doc/tutorial/create-module: describe use of multiple packages within the same module #47501

Open
@bcmills

Description

@bcmills

The tutorial at https://golang.org/doc/tutorial/create-module starts by creating a package within one module, then (in https://golang.org/doc/tutorial/call-module-code) uses that package from within another module.

However, for most user projects we want to encourage users to develop all of their own packages within a single module — the dependency management is much simpler that way, and having multiple modules is only really an advantage if the user needs to release packages from within those modules on independent schedules.

It isn't entirely trivial to figure out how to use one package from another in the same module (see, for example, https://stackoverflow.com/q/68616619).

I think the “Create a Go module” tutorial should demonstrate the use of multiple packages within the same module before the (much more advanced) multi-module workflow.

CC @stevetraut @jayconrod @matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.moduleswebsite

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions