# hashicorp/go-version

A Go (golang) library for parsing and verifying versions and version constraints.

Repository: https://github.com/hashicorp/go-version
Canonical: https://ross.abutalabs.com/products/go-version
Homepage: https://pkg.go.dev/github.com/hashicorp/go-version
Language: Go
License: MPL-2.0
License Family: copyleft
Last push: 2026-08-26T07:23:10+00:00

## Health v2 (maintenance only)
Score: 83/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 53, longevity 100
- inputs: {"age_days": 4543, "days_push": 7, "days_rel": 156, "gap_med": 122, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1770, forks 164 (observed 2026-08-28T04:05:33.995274+00:00)

## What it is
A Go library for parsing, comparing, and verifying semantic versions and version constraints. It supports prerelease versions, sorting collections of versions, incrementing versions, and checking versions against constraint expressions.

## Use cases
- parse semver version strings in go
- check if a version satisfies constraints like >= 1.0, < 1.4
- sort a list of versions correctly including prereleases
- compare two versions to see which is newer
- parse versions with custom prefixes like deployment-v1.2.3
- increment a version number programmatically

## When to choose
- you need SemVer parsing and constraint checking in a Go project
- you need correct sorting of versions including beta/prerelease tags
- you want a widely adopted, stable library (6,000+ importers)

## When to avoid
- you need non-SemVer versioning schemes
- you're not working in Go

## Facets
- artifact type: library
- maturity: stable
- function: parser, developer-tools
- domain: developer-tools, programming-languages
- platform: go, cross-platform
- tags: semver, version-constraints, version-comparison, version-sorting, hashicorp, algorithms

## Member repositories
- hashicorp/go-version (main) score 83

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:33.995274+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:26:02.871572+00:00, confidence not recorded.
  - readme: https://github.com/hashicorp/go-version (fetched 2026-08-28T04:05:33.995274+00:00, sha 78f059b72928)
  - homepage: https://pkg.go.dev/github.com/hashicorp/go-version (fetched 2026-08-29T11:04:22.310747+00:00, sha ac9768580c0b)
  - site_page: https://pkg.go.dev/about (fetched 2026-08-29T11:04:22.320532+00:00, sha 757852027879)
  - site_page: https://go.dev/project (fetched 2026-08-29T11:04:22.322856+00:00, sha d5ca00bb378b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
