coreos/go-semver — pull request #6 by KAllan357 (2014-07-02 00:41:27+00:00)
Title: Add functions to "Bump" major, minor, and patch

Hello CoreOS,

A coworker of mine pointed me to using this awesome library in a project we are writing. Our code is currently doing the work in this pull, but I felt like the code might be useful for this library.

Basically, we wanted to add some additional functions on a `semver.Version`. Particularly, we want to be able to "bump" (increment) the three major components of the Version.

`BumpMajor()` will bump the Major field and reset all the others: `1.0.0 ==> 2.0.0`
`BumpMinor()` will bump the Minor field and reset the fields below Minor: `1.0.0 ==> 1.1.0`
`BumpPatch()` will bump the Patch field and reset the fields below Patch: `1.0.0 ==> 1.0.1`
All 3 functions reset the `Prerelease` and `Metadata` fields.

We think this will be useful from a library perspective when a user wants to move a Version through the SemVer lifecycle. All those details are described in #'s 6,7,8 of the spec:

_Patch version MUST be reset to 0 when minor version is incremented._
_Patch and minor version MUST be reset to 0 when major version is incremented._

Please let me know what you think!