Skip to content

Commit

Permalink
fix: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
a-spiker committed Oct 29, 2024
1 parent e952fdb commit 47f4045
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions asconfig/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
NONE sysproptype = "NONE"
)

const SIZE_128M = 1024 * 1024 * 128
const size128M = 1024 * 1024 * 128

var portRegex = regexp.MustCompile("port")

Expand Down Expand Up @@ -767,9 +767,10 @@ func is128MPowerOf2MultipleField(key string) bool {
switch key {
case "sindex-stage-size":
return true
}

return false
default:
return false
}
}

// is128MPowerOf2MultipleValid checks if the given value is a valid multiple of 128M and a power of 2.
Expand All @@ -794,7 +795,8 @@ func is128MPowerOf2MultipleValid(key string, val interface{}) error {
return fmt.Errorf("invalid value type for %s: %v", key, val)
}

if specFieldValue != 0 && (specFieldValue%SIZE_128M == 0 && (specFieldValue/SIZE_128M&(specFieldValue/SIZE_128M-1)) == 0) {
if specFieldValue != 0 && (specFieldValue%size128M == 0 &&
(specFieldValue/size128M&(specFieldValue/size128M-1)) == 0) {
return nil
}

Expand Down

0 comments on commit 47f4045

Please sign in to comment.