Skip to content

Commit

Permalink
Skip the G601 tests for Go version 1.22
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
  • Loading branch information
ccojocar committed Mar 7, 2024
1 parent 903c75b commit 36878a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rules/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ var _ = Describe("gosec rules", func() {
})

It("should detect implicit aliasing in ForRange", func() {
runner("G601", testutils.SampleCodeG601)
major, minor, _ := gosec.GoVersion()
if major <= 1 && minor < 22 {
runner("G601", testutils.SampleCodeG601)
}
})

It("should detect out of bounds slice access", func() {
Expand Down

0 comments on commit 36878a9

Please sign in to comment.