Skip the G601 tests for Go version 1.22

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
This commit is contained in:
Cosmin Cojocar 2024-03-07 12:18:23 +01:00 committed by Cosmin Cojocar
parent 903c75b05e
commit 36878a9423

View file

@ -192,7 +192,10 @@ var _ = Describe("gosec rules", func() {
}) })
It("should detect implicit aliasing in ForRange", func() { It("should detect implicit aliasing in ForRange", func() {
major, minor, _ := gosec.GoVersion()
if major <= 1 && minor < 22 {
runner("G601", testutils.SampleCodeG601) runner("G601", testutils.SampleCodeG601)
}
}) })
It("should detect out of bounds slice access", func() { It("should detect out of bounds slice access", func() {