mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-20 11:46:36 +00:00
chore(deps): update dependency golangci/golangci-lint to v2.6.0 (#2246)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -96,12 +96,12 @@ func Parse(app *kingpin.Application, args []string) error {
|
||||
// ParseConfigFile manually parses the configuration file from the command line arguments.
|
||||
func ParseConfigFile(args []string) string {
|
||||
for i, cliFlag := range args {
|
||||
if strings.HasPrefix(cliFlag, "--config.file=") {
|
||||
return strings.TrimPrefix(cliFlag, "--config.file=")
|
||||
if configFile, ok := strings.CutPrefix(cliFlag, "--config.file="); ok {
|
||||
return configFile
|
||||
}
|
||||
|
||||
if strings.HasPrefix(cliFlag, "-config.file=") {
|
||||
return strings.TrimPrefix(cliFlag, "-config.file=")
|
||||
if configFile, ok := strings.CutPrefix(cliFlag, "-config.file="); ok {
|
||||
return configFile
|
||||
}
|
||||
|
||||
if strings.HasSuffix(cliFlag, "-config.file") {
|
||||
@@ -148,7 +148,7 @@ func NewConfigFileResolver(filePath string) (*Resolver, error) {
|
||||
return nil, fmt.Errorf("failed to rewind file: %w", err)
|
||||
}
|
||||
|
||||
var rawValues map[string]interface{}
|
||||
var rawValues map[string]any
|
||||
|
||||
decoder = yaml.NewDecoder(file)
|
||||
if err = decoder.Decode(&rawValues); err != nil {
|
||||
|
||||
@@ -36,7 +36,7 @@ func TestConfigFlattening(t *testing.T) {
|
||||
log:
|
||||
level: debug`)
|
||||
|
||||
var data map[string]interface{}
|
||||
var data map[string]any
|
||||
|
||||
err := yaml.Unmarshal(goodYamlConfig, &data)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user