envdoc
envdoc copied to clipboard
Cleanenv tags with commas are not parsed correctly
Tested Version: 1.8.0 This seems to be the cleanenv version of #63.
package main
//go:generate go run ../../ -output doc.txt -target cleanenv -format plaintext
type Config struct {
Location string `env:"LOCATION" env-default:"city,country"`
Cities []string `env:"CITIES" env-separator:","`
States []string `env:"STATES"`
Countries []string `env:"COUNTRIES" env-separator:":"`
}
The above code generates:
Environment Variables
## Config
* `LOCATION` (default: `city`) -
* `CITIES` -
* `STATES` -
* `COUNTRIES` (separated by `:`) -
As seen here, only the first segment before the first comma is included in the generation while everything including and after the comma is lost. In the case of separators, it's totally empty because nothing comes before the single-character comma.