# sethvargo/go-envconfig

A Go library for parsing struct tags from environment variables.

Repository: https://github.com/sethvargo/go-envconfig
Canonical: https://ross.abutalabs.com/products/go-envconfig
Language: Go
License: Apache-2.0
License Family: permissive
Last push: 2026-07-19T19:50:19+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 93, longevity 100
- inputs: {"age_days": 2281, "days_push": 45, "days_rel": 45, "gap_med": 1, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1234, forks 70 (observed 2026-08-28T04:04:04.742561+00:00)

## What it is
A Go library that populates struct fields from environment variables using struct tags. It supports required fields, defaults, prefixes, nested structs, and lookup mutations such as secret resolution.

## Use cases
- parse environment variables into a Go config struct
- load app configuration from env vars with defaults
- require certain environment variables at startup
- populate nested config structs with env prefixes
- resolve secrets from a lookup function during config loading

## When to choose
- you want declarative, struct-tag-based env config in Go
- you need defaults, required fields, or prefixes for shared config
- you want a small, focused, well-maintained library

## When to avoid
- your configuration comes from files or remote sources rather than env vars
- you need complex validation beyond simple required/default handling

## Facets
- artifact type: library
- maturity: stable
- function: configuration-management, developer-tools
- domain: developer-tools, backend
- platform: go, cross-platform
- tags: environment-variables, struct-tags, config-parsing, twelve-factor, configuration

## Member repositories
- sethvargo/go-envconfig (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:04.742561+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-30T08:22:11.604450+00:00, confidence not recorded.
  - readme: https://github.com/sethvargo/go-envconfig (fetched 2026-08-28T04:04:04.742561+00:00, sha 85ca9683c35b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
