Add the ability to change the config file's path via args
This commit is contained in:
parent
804659f860
commit
1c566bad35
6
main.go
6
main.go
|
@ -32,7 +32,11 @@ func init() {
|
|||
}
|
||||
logger = tmpLogger
|
||||
defer logger.Sync()
|
||||
dat, err := os.ReadFile("config.yaml")
|
||||
configFilename := "config.yaml"
|
||||
if len(os.Args) == 2 {
|
||||
configFilename = os.Args[1]
|
||||
}
|
||||
dat, err := os.ReadFile(configFilename)
|
||||
if err != nil {
|
||||
logger.Fatal("failed to read config.yaml", zap.Error(err))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue