Skip to content

Commit 24ba3af

Browse files
alexandearSeigeC
authored andcommitted
dev: gofmt -w -r 'interface{} -> any' pkg scripts (golangci#3742)
1 parent 65d15b0 commit 24ba3af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+180
-180
lines changed

pkg/config/linters_settings.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ type GoCriticSettings struct {
368368
SettingsPerCheck map[string]GoCriticCheckSettings `mapstructure:"settings"`
369369
}
370370

371-
type GoCriticCheckSettings map[string]interface{}
371+
type GoCriticCheckSettings map[string]any
372372

373373
type GoCycloSettings struct {
374374
MinComplexity int `mapstructure:"min-complexity"`
@@ -421,11 +421,11 @@ type GoLintSettings struct {
421421
}
422422

423423
type GoMndSettings struct {
424-
Settings map[string]map[string]interface{} // Deprecated
425-
Checks []string `mapstructure:"checks"`
426-
IgnoredNumbers []string `mapstructure:"ignored-numbers"`
427-
IgnoredFiles []string `mapstructure:"ignored-files"`
428-
IgnoredFunctions []string `mapstructure:"ignored-functions"`
424+
Settings map[string]map[string]any // Deprecated
425+
Checks []string `mapstructure:"checks"`
426+
IgnoredNumbers []string `mapstructure:"ignored-numbers"`
427+
IgnoredFiles []string `mapstructure:"ignored-files"`
428+
IgnoredFunctions []string `mapstructure:"ignored-functions"`
429429
}
430430

431431
type GoModDirectivesSettings struct {
@@ -454,13 +454,13 @@ type GoModGuardSettings struct {
454454
}
455455

456456
type GoSecSettings struct {
457-
Includes []string `mapstructure:"includes"`
458-
Excludes []string `mapstructure:"excludes"`
459-
Severity string `mapstructure:"severity"`
460-
Confidence string `mapstructure:"confidence"`
461-
ExcludeGenerated bool `mapstructure:"exclude-generated"`
462-
Config map[string]interface{} `mapstructure:"config"`
463-
Concurrency int `mapstructure:"concurrency"`
457+
Includes []string `mapstructure:"includes"`
458+
Excludes []string `mapstructure:"excludes"`
459+
Severity string `mapstructure:"severity"`
460+
Confidence string `mapstructure:"confidence"`
461+
ExcludeGenerated bool `mapstructure:"exclude-generated"`
462+
Config map[string]any `mapstructure:"config"`
463+
Concurrency int `mapstructure:"concurrency"`
464464
}
465465

466466
type GosmopolitanSettings struct {
@@ -473,7 +473,7 @@ type GosmopolitanSettings struct {
473473
type GovetSettings struct {
474474
Go string `mapstructure:"-"`
475475
CheckShadowing bool `mapstructure:"check-shadowing"`
476-
Settings map[string]map[string]interface{}
476+
Settings map[string]map[string]any
477477

478478
Enable []string
479479
Disable []string
@@ -628,7 +628,7 @@ type ReviveSettings struct {
628628
EnableAllRules bool `mapstructure:"enable-all-rules"`
629629
Rules []struct {
630630
Name string
631-
Arguments []interface{}
631+
Arguments []any
632632
Severity string
633633
Disabled bool
634634
}

pkg/fsutils/filecache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func PrettifyBytesCount(n int64) string {
5454
func (fc *FileCache) PrintStats(log logutils.Log) {
5555
var size int64
5656
var mapLen int
57-
fc.files.Range(func(_, fileBytes interface{}) bool {
57+
fc.files.Range(func(_, fileBytes any) bool {
5858
mapLen++
5959
size += int64(len(fileBytes.([]byte)))
6060

pkg/golinters/bidichk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func NewBiDiChkFuncName(cfg *config.BiDiChkSettings) *goanalysis.Linter {
1414
a := bidichk.NewAnalyzer()
1515

16-
cfgMap := map[string]map[string]interface{}{}
16+
cfgMap := map[string]map[string]any{}
1717
if cfg != nil {
1818
var opts []string
1919

@@ -45,7 +45,7 @@ func NewBiDiChkFuncName(cfg *config.BiDiChkSettings) *goanalysis.Linter {
4545
opts = append(opts, "POP-DIRECTIONAL-ISOLATE")
4646
}
4747

48-
cfgMap[a.Name] = map[string]interface{}{
48+
cfgMap[a.Name] = map[string]any{
4949
"disallowed-runes": strings.Join(opts, ","),
5050
}
5151
}

pkg/golinters/cyclop.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const cyclopName = "cyclop"
1313
func NewCyclop(settings *config.Cyclop) *goanalysis.Linter {
1414
a := analyzer.NewAnalyzer()
1515

16-
var cfg map[string]map[string]interface{}
16+
var cfg map[string]map[string]any
1717
if settings != nil {
18-
d := map[string]interface{}{
18+
d := map[string]any{
1919
"skipTests": settings.SkipTests,
2020
}
2121

@@ -27,7 +27,7 @@ func NewCyclop(settings *config.Cyclop) *goanalysis.Linter {
2727
d["packageAverage"] = settings.PackageAverage
2828
}
2929

30-
cfg = map[string]map[string]interface{}{a.Name: d}
30+
cfg = map[string]map[string]any{a.Name: d}
3131
}
3232

3333
return goanalysis.NewLinter(

pkg/golinters/deadcode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func NewDeadcode() *goanalysis.Linter {
2121
analyzer := &analysis.Analyzer{
2222
Name: deadcodeName,
2323
Doc: goanalysis.TheOnlyanalyzerDoc,
24-
Run: func(pass *analysis.Pass) (interface{}, error) {
24+
Run: func(pass *analysis.Pass) (any, error) {
2525
prog := goanalysis.MakeFakeLoaderProgram(pass)
2626

2727
issues, err := deadcodeAPI.Run(prog)

pkg/golinters/decorder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func NewDecorder(settings *config.DecorderSettings) *goanalysis.Linter {
1414
a := decorder.Analyzer
1515

1616
// disable all rules/checks by default
17-
cfg := map[string]interface{}{
17+
cfg := map[string]any{
1818
"disable-dec-num-check": true,
1919
"disable-dec-order-check": true,
2020
"disable-init-func-first-check": true,
@@ -31,6 +31,6 @@ func NewDecorder(settings *config.DecorderSettings) *goanalysis.Linter {
3131
a.Name,
3232
a.Doc,
3333
[]*analysis.Analyzer{a},
34-
map[string]map[string]interface{}{a.Name: cfg},
34+
map[string]map[string]any{a.Name: cfg},
3535
).WithLoadMode(goanalysis.LoadModeSyntax)
3636
}

pkg/golinters/depguard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func NewDepguard(settings *config.DepGuardSettings) *goanalysis.Linter {
3636
).WithContextSetter(func(lintCtx *linter.Context) {
3737
dg, err := newDepGuard(settings)
3838

39-
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
39+
analyzer.Run = func(pass *analysis.Pass) (any, error) {
4040
if err != nil {
4141
return nil, err
4242
}

pkg/golinters/dogsled.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func NewDogsled(settings *config.DogsledSettings) *goanalysis.Linter {
2424
analyzer := &analysis.Analyzer{
2525
Name: dogsledName,
2626
Doc: goanalysis.TheOnlyanalyzerDoc,
27-
Run: func(pass *analysis.Pass) (interface{}, error) {
27+
Run: func(pass *analysis.Pass) (any, error) {
2828
issues := runDogsled(pass, settings)
2929

3030
if len(issues) == 0 {

pkg/golinters/dupl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func NewDupl(settings *config.DuplSettings) *goanalysis.Linter {
2525
analyzer := &analysis.Analyzer{
2626
Name: duplName,
2727
Doc: goanalysis.TheOnlyanalyzerDoc,
28-
Run: func(pass *analysis.Pass) (interface{}, error) {
28+
Run: func(pass *analysis.Pass) (any, error) {
2929
issues, err := runDupl(pass, settings)
3030
if err != nil {
3131
return nil, err

pkg/golinters/dupword.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
func NewDupWord(setting *config.DupWordSettings) *goanalysis.Linter {
1414
a := dupword.NewAnalyzer()
1515

16-
cfgMap := map[string]map[string]interface{}{}
16+
cfgMap := map[string]map[string]any{}
1717
if setting != nil {
18-
cfgMap[a.Name] = map[string]interface{}{
18+
cfgMap[a.Name] = map[string]any{
1919
"keyword": strings.Join(setting.Keywords, ","),
2020
}
2121
}

0 commit comments

Comments
 (0)