Satisfies
Overview
Satisfies reports whether version matches constraint (npm range syntax).
If you are coming from Node.js, the closest pattern is semver.satisfies(v, range).
Signature
go
func Satisfies(version, constraint string) boolCompare: Node.js · Standard Go · gox
js
semver.satisfies(v, range)go
// github.com/Masterminds/semver/v3go
import "github.com/sahilkhaire/gox/semver"
semver.Satisfies(v, constraint)Example
go
import "github.com/sahilkhaire/gox/semver"
semver.Satisfies(v, constraint)Tips
Import github.com/sahilkhaire/gox/semver and call Satisfies 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.