> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Module version numbering

> Explains semantic versioning for modules, showing how MAJOR MINOR PATCH and pre-release identifiers communicate stability, compatibility, and upgrade risk.

This article explains how module version numbering communicates stability and backward-compatibility guarantees. A module’s version string helps both consumers and authors decide whether an upgrade is safe, and which releases introduce new features, bug fixes, or breaking changes.

<Callout icon="lightbulb" color="#1CB2FE">
  Read version numbers before upgrading a dependency. Proper versioning signals what to expect from a release: new features, bug fixes, or breaking changes.
</Callout>

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/NQ3INgb8I78TJYeC/images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-numbering-stability-changes.jpg?fit=max&auto=format&n=NQ3INgb8I78TJYeC&q=85&s=88af4b2c6d3bf4d42378c7a4f8c256b2" alt="A dark presentation slide titled &#x22;Module version numbering.&#x22; It contains two bullet points explaining that a module's version number signals its stability/backward compatibility and that each release number reflects the nature of changes since the previous release." width="1920" height="1080" data-path="images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-numbering-stability-changes.jpg" />
</Frame>

When you depend on external modules, inspect their version numbers to evaluate stability before upgrading. When publishing your own module, pick version numbers that accurately reflect the compatibility guarantees you intend to provide.

Most modules follow semantic versioning (semver). The common format is MAJOR.MINOR.PATCH, optionally suffixed with a pre-release identifier (for example, `v1.4.0-beta.2`). Each segment conveys a distinct meaning:

* MAJOR: breaking changes to the public API (not backward compatible)
* MINOR: new features that remain backward-compatible
* PATCH: backward-compatible bug fixes and small improvements

Below is a visual highlighting the major version component.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/NQ3INgb8I78TJYeC/images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-major-highlight.jpg?fit=max&auto=format&n=NQ3INgb8I78TJYeC&q=85&s=297803b1bea0c45d86e8aba29ae7fa32" alt="A presentation slide titled &#x22;Module version numbering&#x22; showing the version string &#x22;v1.4.0 – beta.2&#x22; with the &#x22;1&#x22; highlighted and labeled &#x22;major version.&#x22;" width="1920" height="1080" data-path="images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-major-highlight.jpg" />
</Frame>

A change in the major number signals incompatible API changes. Consumers should treat major-version upgrades as potentially breaking and plan accordingly (read CHANGELOGs, run tests, and check migration notes).

Here is the minor version explanation with the corresponding diagram.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/NQ3INgb8I78TJYeC/images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-minor-highlight.jpg?fit=max&auto=format&n=NQ3INgb8I78TJYeC&q=85&s=a95679bce21f1a7dd17a3c2b22829dc1" alt="A dark presentation slide titled &#x22;Module version numbering&#x22; showing the version string &#x22;v 1.4.0 - beta.2&#x22; with the &#x22;4&#x22; highlighted and labeled &#x22;minor version.&#x22;" width="1920" height="1080" data-path="images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-minor-highlight.jpg" />
</Frame>

Increment the minor version to add new, backward-compatible features or improvements. Minor releases are intended to be safe upgrades for existing consumers.

This diagram highlights the patch segment.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/NQ3INgb8I78TJYeC/images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-numbering-patch-highlight.jpg?fit=max&auto=format&n=NQ3INgb8I78TJYeC&q=85&s=102d9f8f7635f7a0ec898c2a561cbcd2" alt="A slide titled &#x22;Module version numbering&#x22; showing the example version string &#x22;v 1.4.0 - beta.2&#x22; with the final 0 highlighted and labeled &#x22;patch version.&#x22; The slide has a dark background with teal and purple highlights." width="1920" height="1080" data-path="images/Advanced-Golang/Introduction-Modules-Packages-and-Imports/Module-version-numbering/module-version-numbering-patch-highlight.jpg" />
</Frame>

Patch releases contain bug fixes and small, backward-compatible changes. These should be the least risky upgrades and typically don't require code changes.

Summary table

| Segment | Purpose | Example |
| -: | - | - |
| MAJOR | Breaking API changes — may require code changes from consumers. | `v2.0.0` |
| MINOR | New features or improvements that remain backward-compatible. | `v1.4.0` |
| PATCH | Backward-compatible bug fixes and small tweaks. | `v1.4.1` |
| Pre-release | Experimental or test releases (alpha, beta, rc). Not considered final/stable. | `v1.4.0-beta.2` |

Important notes about special cases:

* Versions with a major version of zero (`v0.x`) indicate initial development. Authors may introduce breaking changes in minor or patch releases during this phase.
* Pre-release identifiers (for example, `alpha`, `beta`, `rc`) mark releases that are not final and do not carry the same stability guarantees as final releases.

<Callout icon="warning" color="#FF6B6B">
  `v0.x` releases are considered unstable. Authors can introduce breaking changes in minor or patch updates during initial development — consumers should be cautious when depending on `v0` modules.
</Callout>

Example of a pre-release notation:

```text theme={null}
v1.4.0-beta.2
Pre-release identifier: beta.2
```

Further reading and references

* [Semantic Versioning (semver.org)](https://semver.org/)
* [Go Modules: Versioning and module compatibility](https://golang.org/ref/mod#version-compatibility)

That covers the essentials of module version numbering and what each segment of a semantic version communicates. Follow semantic versioning practices to set clear expectations for your users and to evaluate dependency upgrades safely.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/advanced-golang/module/6ce7d245-515e-428d-9672-915e49a8ebd6/lesson/711cc7ac-1e91-495d-86af-03459d9026a2" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.