Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

/p/nym-moultest123/x/daily/semver/v0

Directory · 4 Files
README.md Open

gno.land/p/nym-moultest123/x/daily/semver/v0

Semantic Versioning 2.0.0 parser + comparator — Parse, Compare, and the Version type (with Canonical).

An on-chain port of the core of Go's golang.org/x/mod/semver (and the spirit of Masterminds/semver). Parses vMAJOR.MINOR.PATCH[-prerelease][+build] and compares with correct precedence: numeric fields compare numerically (so 1.2.3 < 1.2.10), a pre-release ranks below its release (1.0.0-alpha < 1.0.0), numeric pre-release identifiers rank below alphanumeric ones, and build metadata is ignored. Pure and deterministic — no avl, no chain imports, no ambient state.

1import "gno.land/p/nym-moultest123/x/daily/semver/v0"
2
3v, err := semver.Parse("v1.0.0-rc.1+ci.7") // Version{Major:1, Pre:["rc","1"], …}
4semver.Compare("1.2.3", "1.2.10")          // -1
5v.Canonical()                              // "1.0.0-rc.1+ci.7"

Live demo: r/moul/x/daily/semverdemo · render it at /r/nym-moultest123/x/daily/semverdemo/v0.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.