mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Bump golangci-lint v1.57.1 (#84998)
* bump golangci-lint v1.57.1 * update setting * remove goconst * fix linting issues * prettier * fix G601 * go mod tidy go work sync
This commit is contained in:
@@ -217,6 +217,7 @@ func (r ruleWithFolder) Fingerprint() fingerprint {
|
||||
writeBytes(nil)
|
||||
return
|
||||
}
|
||||
// #nosec G103
|
||||
// avoid allocation when converting string to byte slice
|
||||
writeBytes(unsafe.Slice(unsafe.StringData(s), len(s)))
|
||||
}
|
||||
|
||||
@@ -198,7 +198,10 @@ func (st DBstore) UpdateAlertRules(ctx context.Context, rules []ngmodels.UpdateR
|
||||
}
|
||||
|
||||
ruleVersions := make([]ngmodels.AlertRuleVersion, 0, len(rules))
|
||||
for _, r := range rules {
|
||||
for i := range rules {
|
||||
// We do indexed access way to avoid "G601: Implicit memory aliasing in for loop."
|
||||
// Doing this will be unnecessary with go 1.22 https://stackoverflow.com/a/68247837/767660
|
||||
r := rules[i]
|
||||
var parentVersion int64
|
||||
r.New.ID = r.Existing.ID
|
||||
r.New.Version = r.Existing.Version // xorm will take care of increasing it (see https://xorm.io/docs/chapter-06/1.lock/)
|
||||
|
||||
Reference in New Issue
Block a user