diff --git a/internal/config/values.go b/internal/config/values.go index f60bb22..e3305f9 100644 --- a/internal/config/values.go +++ b/internal/config/values.go @@ -2,6 +2,8 @@ package config import "strings" +var ReservedKeys = []string{"Value", "Val", "V"} + type Values map[string]any func (values Values) Fill(rawValues map[string]string) { diff --git a/internal/visitor/find_args.go b/internal/visitor/find_args.go index f8828e9..0cb1bc7 100644 --- a/internal/visitor/find_args.go +++ b/internal/visitor/find_args.go @@ -75,6 +75,11 @@ outer: continue outer } } + for _, reserved := range config.ReservedKeys { + if k == reserved { + continue outer + } + } result = append(result, k+"=") } return result diff --git a/internal/visitor/find_args_test.go b/internal/visitor/find_args_test.go index 12af56b..47b3e42 100644 --- a/internal/visitor/find_args_test.go +++ b/internal/visitor/find_args_test.go @@ -51,6 +51,7 @@ func TestFindArgs_Values(t *testing.T) { {"simple", fields{valMap: map[string]struct{}{"a": {}}}, []string{"a="}}, {"nested", fields{valMap: map[string]struct{}{"a.b": {}}}, []string{"a.b="}}, {"duplicate", fields{conf: config.Config{Values: map[string]any{"b": "b"}}, valMap: map[string]struct{}{"b": {}}}, []string{}}, + {"reserved", fields{valMap: map[string]struct{}{"Value": {}}}, []string{}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {