docenv

command
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 2 Imported by: 0

README

docenv - linter for environment documentation

The linter check that all environment variable fields with env tag are documented.

Install linter

go install github.com/g4s8/envdoc/docenv@latest

Example

The struct with undocumented fields:

type Config struct {
	Hosts []string `env:"HOST,required", envSeparator:";"`
	Port  int      `env:"PORT,notEmpty"`
}

Run the linter:

$ go vet -vettool=$(which docenv) ./config.go
config.go:12:2: field `Hosts` with `env` tag should have a documentation comment
config.go:13:2: field `Port` with `env` tag should have a documentation comment

Usage

Flags:

  • env-name sets custom env tag name (default env)
go vet go vet -vettool=$(which docenv) -docenv.env-name=foo ./config.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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