Skip to content

Commit 4118d9d

Browse files
committed
review
1 parent 3d8360b commit 4118d9d

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

pkg/commands/internal/migrate/migrate_linters_settings.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -789,15 +789,20 @@ func toSpancheckSettings(old versionone.SpancheckSettings) versiontwo.SpancheckS
789789
}
790790

791791
func toStaticCheckSettings(old versionone.LintersSettings) versiontwo.StaticCheckSettings {
792-
checks := Unique(slices.Concat(old.Staticcheck.Checks, old.Stylecheck.Checks, old.Gosimple.Checks))
793-
794-
slices.SortFunc(checks, func(a, b string) int {
795-
if a == "*" || a == "all" {
796-
return 1
797-
}
798-
799-
return strings.Compare(a, b)
800-
})
792+
checks := slices.Compact(
793+
slices.SortedFunc(
794+
slices.Values(
795+
slices.Concat(old.Staticcheck.Checks, old.Stylecheck.Checks, old.Gosimple.Checks),
796+
),
797+
func(a, b string) int {
798+
if a == "*" || a == "all" {
799+
return 1
800+
}
801+
802+
return strings.Compare(a, b)
803+
},
804+
),
805+
)
801806

802807
return versiontwo.StaticCheckSettings{
803808
Checks: checks,

0 commit comments

Comments
 (0)