semver

package
v0.0.0-...-210767f Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package semver provides shared utilities for manipulating Go semantic versions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Affects

func Affects(a []osv.Range, v string) bool

func ContainsSemver

func ContainsSemver(ar osv.Range, v string) bool

ContainsSemver checks if semver version v is in the range encoded by ar. If ar is not a semver range, returns false. A range is interpreted as a left-closed and right-open interval.

Assumes that

  • exactly one of Introduced or Fixed fields is set
  • ranges in ar are not overlapping
  • beginning of time is encoded with .Introduced="0"
  • no-fix is not an event, as opposed to being an event where Introduced="" and Fixed=""

func GoTagToSemver

func GoTagToSemver(tag string) string

This is a modified copy of pkgsite/internal/stdlib:VersionForTag.

func Less

func Less(v1, v2 string) bool

Less returns whether v1 < v2, where v1 and v2 are semver versions with either a "v", "go" or no prefix.

func NonSupersededFix

func NonSupersededFix(ranges []osv.Range) string

NonSupersededFix returns a fixed version from ranges that is not superseded by any other fix or any other introduction of a vulnerability. Returns "" in case there is no such fixed version.

func Valid

func Valid(v string) bool

Valid returns whether v is valid semver, allowing either a "v", "go" or no prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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