Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Applying semantic versioning to Go packages

The semantic versioning definition that we discussed in the previous section left a few questions unanswered. To begin with, what should be the initial version number for a new package? What is more, as an external user of the package, how would we know when the package API has been stable enough for us to use it safely in our code?

There is no better way to answer these questions than with the help of a small example. Let's consider the following code snippet from an as yet unreleased package that deals with weather predictions:

package weather

// Prediction describes a weather prediction.
type Prediction uint8

// The supported weather prediction types.
const (
    Sunny Prediction = iota Rain Overcast ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content