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

semver package

Overview

Package semver is an on-chain port of the core of golang.org/x/mod/semver (and the spirit of github.com/Masterminds/semver): parse "vMAJOR.MINOR.PATCH [-prerelease][+build]" strings and compare them with correct Semantic Versioning 2.0.0 precedence. Pure and deterministic — no time, randomness, goroutines, or I/O.

Function

Compare

func Compare(a, b string) int

Compare returns -1, 0, or +1 as a < b, a == b, or a > b under semver precedence. Unparseable inputs sort after everything valid (and equal to each other), so Compare never panics.

Params

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/semver.Compare(,)"

Result