Extra tools extending usage of go-envconfig library.
go get github.com/b0ch3nski/go-envconfig-extra
import "github.com/b0ch3nski/go-envconfig-extra/envconfigext"
type Config struct {
Password1 string `env:"PASS1,required" secret:"redact"`
Password2 string `env:"PASS2,required" secret:"mask=4"`
ArbitraryFile envconfigext.FileContent `env:"FILE"`
Certificate envconfigext.X509Cert `env:"CERT"`
}
func (c Config) String() string {
return envconfigext.StructFieldScan(c)
}