fix(config): fix config marshaling producing unreadable config file (#402)

There are two practical changes when the config gets updated:
- The `forgetoption` and `configoption` bug is now gone
- Superfluous config keys no longer get written out
This commit is contained in:
Boris Bera
2024-11-04 09:20:42 -05:00
committed by GitHub
parent 8a773856de
commit 6895df1c83
4 changed files with 76 additions and 29 deletions

View File

@@ -23,11 +23,11 @@ type OptionMap map[string][]interface{}
type Options map[string]OptionMap
type Config struct {
Version string `mapstructure:"version"`
Extras interface{} `mapstructure:"extras"`
Locations map[string]Location `mapstructure:"locations"`
Backends map[string]Backend `mapstructure:"backends"`
Global Options `mapstructure:"global"`
Version string `mapstructure:"version" yaml:"version"`
Extras interface{} `mapstructure:"extras" yaml:"extras"`
Locations map[string]Location `mapstructure:"locations" yaml:"locations"`
Backends map[string]Backend `mapstructure:"backends" yaml:"backends"`
Global Options `mapstructure:"global" yaml:"global"`
}
var once sync.Once