Skip to content

Commit

Permalink
sets configured to true
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava authored Sep 17, 2023
1 parent 7306bfb commit 8a284ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rule/enforce-map-style.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@ type EnforceMapStyleRule struct {
func (r *EnforceMapStyleRule) configure(arguments lint.Arguments) {
r.Lock()
defer r.Unlock()

if r.configured {
return
}
r.configured = true

if len(arguments) < 1 {
r.enforceMapStyle = enforceMapStyleTypeAny
return
}

enforceMapStyle, ok := arguments[0].(string) // Alt. non panicking version
enforceMapStyle, ok := arguments[0].(string)
if !ok {
panic(fmt.Sprintf("Invalid argument '%v' for 'enforce-map-style' rule. Expecting string, got %T", arguments[0], arguments[0]))
}
Expand Down

0 comments on commit 8a284ae

Please sign in to comment.