fix: capitalize and add config tags to env and loglevel fields
This commit is contained in:
parent
313bc7f9bb
commit
e7079e9892
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue