From 5da98401aa424ed503f5ccb4203eed0cc56baee4 Mon Sep 17 00:00:00 2001 From: William Johansson Date: Mon, 9 Sep 2024 10:25:17 +0200 Subject: [PATCH] chore(sage): bump to v0.306.0 Linter fixes: * ignore G115 in filtering/lexer Not likely that `n` (width of a rune) is large enough to overflow an int32. * rename variable to avoid shadowing built-in function Pleases the predeclared linter. --- .sage/go.mod | 2 +- .sage/go.sum | 4 ++-- filtering/lexer.go | 2 +- filtering/macro.go | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.sage/go.mod b/.sage/go.mod index 584ffb24c1..5acf7a0ebc 100644 --- a/.sage/go.mod +++ b/.sage/go.mod @@ -2,4 +2,4 @@ module sage go 1.19 -require go.einride.tech/sage v0.293.0 +require go.einride.tech/sage v0.306.0 diff --git a/.sage/go.sum b/.sage/go.sum index 1bc2856a53..2bd940336a 100644 --- a/.sage/go.sum +++ b/.sage/go.sum @@ -1,2 +1,2 @@ -go.einride.tech/sage v0.293.0 h1:y9jHXCAMx0HrIU4bKGLhc1jQl6iWRMly0f4MPOlzEYE= -go.einride.tech/sage v0.293.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= +go.einride.tech/sage v0.306.0 h1:FjnGGXqA11NJnV11zYhTq+tcMN4vrqMdBeSLnwfSAs0= +go.einride.tech/sage v0.306.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= diff --git a/filtering/lexer.go b/filtering/lexer.go index a57db8ed74..25d7eeb270 100644 --- a/filtering/lexer.go +++ b/filtering/lexer.go @@ -133,7 +133,7 @@ func (l *Lexer) nextRune() (rune, error) { } else { l.tokenEnd.Column++ } - l.tokenEnd.Offset += int32(n) + l.tokenEnd.Offset += int32(n) // #nosec G115 return r, nil } diff --git a/filtering/macro.go b/filtering/macro.go index bd68d20615..f959cffb13 100644 --- a/filtering/macro.go +++ b/filtering/macro.go @@ -77,12 +77,12 @@ func (c *Cursor) Replace(newExpr *expr.Expr) { } func maxID(exp *expr.Expr) int64 { - var max int64 + var maxFound int64 Walk(func(_, _ *expr.Expr) bool { - if exp.GetId() > max { - max = exp.GetId() + if exp.GetId() > maxFound { + maxFound = exp.GetId() } return true }, exp) - return max + return maxFound }