Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read the targetfile when I placed the config file in a subpakage and then run program with Environment argument #60

Open
surandor opened this issue Aug 31, 2020 · 0 comments

Comments

@surandor
Copy link

code like:
configPath := flag.String("conf", "config/config.yml", "default config file name : config.yml")
env := flag.String("env", "", "run environment: default: test, opt: prod / dev")
flag.Parse()
configor.New(&configor.Config{Environment: *env}).Load(&Config, *configPath)

the run command is :
go build -o main.exe main.go
main.exe -conf ./config/config.yml -env prod

but the program load the file named config.yml not config.prod.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant