Skip to content

Commit 96e6f65

Browse files
fix(golangcilint): fix warnings
1 parent a18866a commit 96e6f65

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/codegen/imports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ func importPathToAssumedName(importPath string) string {
9999
}
100100
base = strings.TrimPrefix(base, "go-")
101101
if i := strings.IndexFunc(base, func(r rune) bool {
102-
return !('a' <= r && r <= 'z' || 'A' <= r && r <= 'Z' || '0' <= r && r <= '9' || r == '_' ||
103-
r >= utf8.RuneSelf && (unicode.IsLetter(r) || unicode.IsDigit(r)))
102+
return (r < 'a' || r > 'z') && (r < 'A' || r > 'Z') && (r < '0' || r > '9') && r != '_' &&
103+
(r < utf8.RuneSelf || (!unicode.IsLetter(r) && !unicode.IsDigit(r)))
104104
}); i >= 0 {
105105
base = base[:i]
106106
}

tools/sgartifactregistry/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ func NpmAuthenticate(ctx context.Context, packageJSONDir, registryURL string) er
5757
yarnMajor = strings.Split(version, ".")[0]
5858
}
5959

60-
switch {
60+
switch yarnMajor {
6161
// If yarn v1 or npm we use npm config
62-
case yarnMajor == "1":
62+
case "1":
6363
cmd = sg.Command(
6464
ctx,
6565
"npm",

0 commit comments

Comments
 (0)