prysm-pulse/tools/nogo_config/config_exclusion.go
Preston Van Loon f537a98fcd
Add staticchecks to bazel builds (#13298)
* Update staticcheck to latest

* Add static checks while ignoring for third party / external stuff

* Added a hack to keep go mod happy.

* disable SA2002

* Pin go mod tidy checker image to golang:1.20-alpine
2023-12-08 05:42:55 +00:00

18 lines
482 B
Go

package main
// AddExclusion adds an exclusion to the Configs, if they do not exist already.
func (c Configs) AddExclusion(check string, exclusions []string) {
for _, e := range exclusions {
if cc, ok := c[check]; !ok {
c[check] = Config{
ExcludeFiles: make(map[string]string),
}
} else if cc.ExcludeFiles == nil {
cc.ExcludeFiles = make(map[string]string)
}
if _, ok := c[check].ExcludeFiles[e]; !ok {
c[check].ExcludeFiles[e] = exclusionMessage
}
}
}