Go major versions: v2 paths and semantic import versioning

11 steps · about 3 h 32 min · Intermediate

  1. Module version numbering (doc, go.dev, 10 min)

    Start with what v0, v1, pre-release and major numbers signal before learning the path rules.

  2. Publishing Go Modules (article, The Go Blog, 15 min)

    It shows tagging v0 and v1 releases and the rule never to rewrite a published version.

  3. Go += Package Versioning (Go & Versioning, Part 1) (article, research!rsc (Russ Cox), 25 min)

    The import compatibility rule is the idea behind /v2 paths, and this is where its author states it.

  4. Semantic Import Versioning (Go & Versioning, Part 3) (article, research!rsc (Russ Cox), 30 min)

    A dependency story shows why hiding major versions causes diamond-dependency breakage.

  5. Go Modules Reference (reference, go.dev, 25 min)

    Read the official 'Major version suffixes' section to pin down the exact rules, including +incompatible.

  6. Go Modules: v2 and Beyond (article, The Go Blog, 20 min)

    A worked example of releasing v2 using the major-subdirectory strategy and pre-release tags.

  7. Migrating to Go Modules (article, The Go Blog, 15 min)

    It covers projects already tagged v2+ before modules and how to avoid breaking their users.

  8. Go Wiki: Go Modules (reference, go.dev, 20 min)

    The FAQ answers edge cases, such as how v2+ modules behave for non-module users.

  9. Managing module source (doc, go.dev, 12 min)

    Learn how repository layout and several go.mod files map onto module paths and versions.

  10. Publishing a module (doc, go.dev, 10 min)

    Finish with the practical steps: tidy, test, tag, push and prompt the proxy index.

  11. The Principles of Versioning in Go (Go & Versioning, Part 11) (article, research!rsc (Russ Cox), 30 min)

    A closing look at why Go chose semantic import versioning and minimal version selection.