🔧 Updated env config
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Maxim Lebedev 2023-03-15 06:20:52 +06:00
parent dd29a48db3
commit 11255805b1
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
2 changed files with 6 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import (
type Config struct {
BaseURL *url.URL `env:"BASE_URL" envDefault:"http://localhost:3000/"`
Bind string `end:"BIND" envDefault:":3000"`
Bind string `end:"BIND,required" envDefault:":3000"`
Name string `env:"NAME" envDefault:"WebSub"`
}

View File

@ -56,7 +56,11 @@ func main() {
ctx := context.Background()
config := new(domain.Config)
if err := env.Parse(config, env.Options{Prefix: "HUB_"}); err != nil {
if err := env.Parse(config, env.Options{
Prefix: "HUB_",
TagName: "env",
UseFieldNameByDefault: true,
}); err != nil {
logger.Fatalln(err)
}