suborbital / vektor

Opinionated production-grade HTTP server framework for Go
Apache License 2.0
82 stars 8 forks source link

fix: Remove leading underscore #113

Closed arbourd closed 1 year ago

arbourd commented 1 year ago

go-envconfig made a change in v0.8.x where any leading underscore (ex: _APP_NAME) is invalid and will break env var parsing.

This commit removes the leading prefixed underscore from built-in options, and sets the default prefix string to VK_.

All new prefixes must end with an underscore when this change is released and adopted. For example, an app that used _MY_ENV for an env var and PREFIX for the prefix, but be changed to PREFIX_ for the prefix and MY_ENV for the env var.

cohix commented 1 year ago

@arbourd in the finalize method, could you add a check to ensure that any provided prefix includes a trailing underscore, and add it automatically if it doesn't?