Skip to content
Node: semver.satisfies(v, range)github.com/sahilkhaire/gox/semver

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) bool

Compare: Node.js · Standard Go · gox

js
semver.satisfies(v, range)
go
// github.com/Masterminds/semver/v3
go
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.

Back to semver package overview

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