fix: capitalize and add config tags to env and loglevel fields

This commit is contained in:
garionion (aider) 2025-02-25 23:01:36 +01:00
parent 313bc7f9bb
commit e7079e9892

View file

@ -45,8 +45,8 @@ type DBConfig struct {
}
type Config struct {
env string
loglevel string
Env string `config:"env"`
Loglevel string `config:"loglevel"`
Server struct {
Port int `config:"port"`
} `config:"server"`
@ -67,7 +67,7 @@ func main() {
cfgErr := cfgReader.Read(&cfg)
zapcfg := zap.NewProductionConfig()
if cfg.env == "dev" {
if cfg.Env == "dev" {
zapcfg = zap.NewDevelopmentConfig()
}
logger, err := zapcfg.Build()