go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Multi-environment configuration merge support

Open greper opened this issue 1 year ago • 2 comments

Describe the solution you'd like First , I know go run app.go-f etc/app.yaml can switch config

But I don't want to copy all the configuration in app-prod.yaml

I want to configure only the parts that must be modified in app-prod.yaml and inherit the rest from app.yaml

configs := []*configFiles
conf.MustLoad(configFiles, &c, conf.UseEnv())

We can use loader to load multiple configuration files as json, and then combine the previous configuration with the later configuration, and finally convert into a config struct

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

greper avatar Apr 29 '23 14:04 greper