liveBook · Manning

Breaking change

As explained in Go in Action, Second Edition

A breaking change is a modification that can prevent existing consumers from continuing to work without updates.

A breaking change modifies an API in a way that can stop existing consumers from working without updates. In Go module versioning, it requires a major SemVer increment. section 11.2

Independent modules let teams release compatible changes separately, but a breaking domain change propagates to dependent modules. If the domain moves to v2.0.0, both the API and worker must update their go.mod dependencies. section 11.3.5

Use SemVer to distinguish change impact:

  • Increment the major version for incompatible API changes. section 11.2
  • Increment the minor version when adding functionality without breaking backward compatibility. section 11.2
  • Increment the patch version for backward-compatible bug fixes. section 11.2

Domain version change

A domain module released as domain/v0.0.1 can later receive a breaking change and move to v2.0.0. The API and worker then update their domain requirements, while independent API or worker releases can continue without affecting each other when the domain contract remains satisfied. section 11.3.5 section 11.2

# Release updated API with new endpoint
cd api
git add .
git commit -m "Add filtering options to articles endpoint"
git tag api/v1.1.0
git push origin api/v1.1.0

# Release optimized worker
cd worker
git add .
git commit -m "Optimize feed fetching with connection pooling"
git tag worker/v1.1.0
git push origin worker/v1.1.0

# Domain remains at v0.0.1 (no changes needed)#1

Compare independent API and worker release tags while the domain remains unchanged. section 11.3.5

How Go in Action, Second Edition covers it

How deep it goes
Defines SemVer impact categories and traces dependent go.mod updates, without detailing how to identify every incompatible API modification.
Examples
Uses domain/v0.0.1, a hypothetical domain/v2.0.0 transition, and independent api/v1.1.0 and worker/v1.1.0 Git tags.
What you can do after
Operate/configure Go module releases by selecting SemVer increments and updating dependent module requirements after incompatible changes.
How it connects
Connects semantic versioning, backward compatibility, Go modules, API contracts, and independent module versioning.

Also explained in

Compare how 5 books explain breaking change →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Go in Action, Second Edition. The section links point to the parts of the book it draws on.