Inc
Overview
Inc increments part (major, minor, patch) and returns the new version string.
If you are coming from Node.js, the closest pattern is semver.inc(v, 'minor').
Signature
go
func Inc(version, part string) (string, error)Compare: Node.js · Standard Go · gox
js
semver.inc(v, 'minor')go
// github.com/Masterminds/semver/v3go
import "github.com/sahilkhaire/gox/semver"
semver.Inc(v, part)Example
go
import "github.com/sahilkhaire/gox/semver"
semver.Inc(v, part)Tips
Import github.com/sahilkhaire/gox/semver and call Inc directly. See the comparison below for the standard library equivalent.
Standard library alternative
gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.