File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,9 @@ func (c *Config) rel(path string) string {
387
387
// WithArgs returns a new config with the given arguments added to the configuration.
388
388
func (c * Config ) WithArgs (args map [string ]TomlInfo ) {
389
389
for _ , value := range args {
390
- if value .Value != nil && * value .Value != unsetDefault {
390
+ // Ignore values that match the default configuration.
391
+ // This ensures user-specified configurations are not overwritten by default values.
392
+ if value .Value != nil && * value .Value != value .fieldValue {
391
393
v := reflect .ValueOf (c )
392
394
setValue2Struct (v , value .fieldPath , * value .Value )
393
395
}
Original file line number Diff line number Diff line change 4
4
"flag"
5
5
)
6
6
7
- const unsetDefault = "DEFAULT"
8
-
9
7
// ParseConfigFlag parse toml information for flag
10
8
func ParseConfigFlag (f * flag.FlagSet ) map [string ]TomlInfo {
11
9
c := defaultConfig ()
You can’t perform that action at this time.
0 commit comments