Skip to content
Node: semver.inc(v, 'minor')github.com/sahilkhaire/gox/semver

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/v3
go
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.

Back to semver package overview

MIT Licensed · Built for Node.js developers moving to Go