Skip to content

Commit 4bf2e56

Browse files
Fix linter issue with golangci-lint v2
Signed-off-by: James Pond <james@cipher.host>
1 parent 61e4398 commit 4bf2e56

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/testhelper/testhelper.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ package testhelper
88
// IsHex returns true if the string contains only hexadecimal characters.
99
func IsHex(str string) bool {
1010
for _, rune := range str {
11-
if !((rune >= '0' && rune <= '9') || (rune >= 'a' && rune <= 'f') || (rune >= 'A' && rune <= 'F')) {
11+
var (
12+
isDigit = rune >= '0' && rune <= '9'
13+
isLowerHex = rune >= 'a' && rune <= 'f'
14+
isUpperHex = rune >= 'A' && rune <= 'F'
15+
)
16+
17+
if !isDigit && !isLowerHex && !isUpperHex {
1218
return false
1319
}
1420
}

0 commit comments

Comments
 (0)