semver

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package semver provides thin helpers for semver constraint checking, wrapping golang.org/x/mod/semver and implementing caret (^) and tilde (~) range semantics as used in melon.yaml dependency constraints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCompatible

func IsCompatible(constraint, version string) bool

IsCompatible reports whether version satisfies constraint.

Supported constraint prefixes:

  • "^X.Y.Z" caret — compatible with X.Y.Z; allows patch and minor bumps within the same major version (^1.2.3 matches >=1.2.3, <2.0.0). Special case: when major is 0, only patch bumps are allowed (^0.2.3 matches >=0.2.3, <0.3.0).
  • "~X.Y.Z" tilde — allows patch bumps only (~1.2.3 matches >=1.2.3, <1.3.0).
  • "X.Y.Z" exact match (no prefix).

Both constraint and version may omit the leading "v".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL