As in: v1.2.3 Bump minor => v1.3.0
Extends golang.org/x/mod/semver
import "github.com/tomharrisonjr/semverbump"func Bump(version, bumpType string) string- version is a valid semver string
- if empty, respects the bumpType, so
Bump("", "patch")will returnv0.0.1 - if the passed version does not include the leading
v, it will be added, soBump("0.0.1", "patch")will returnv0.0.2
- if empty, respects the bumpType, so
- bumpType is a string of
major,minor, orpatch.
func main()
version := "v0.0.1"
newVersion := semverbump.Bump(version, "patch")
fmt.Println(newVersion)Sure! Just open a PR.
Better yet, I totally can't believe this doesn't like completely exist already so if it does, please let me know.
MIT
That's all folks.