@@ -98,7 +98,7 @@ var _ = Describe("Analyzer", func() {
98
98
99
99
// Rule for MD5 weak crypto usage
100
100
sample := testutils .SampleCodeG401 [0 ]
101
- source := sample .Code
101
+ source := sample .Code [ 0 ]
102
102
analyzer .LoadRules (rules .Generate (rules .NewRuleFilter (false , "G401" )).Builders ())
103
103
104
104
controlPackage := testutils .NewTestPackage ()
@@ -114,7 +114,7 @@ var _ = Describe("Analyzer", func() {
114
114
It ("should not report errors when a nosec comment is present" , func () {
115
115
// Rule for MD5 weak crypto usage
116
116
sample := testutils .SampleCodeG401 [0 ]
117
- source := sample .Code
117
+ source := sample .Code [ 0 ]
118
118
analyzer .LoadRules (rules .Generate (rules .NewRuleFilter (false , "G401" )).Builders ())
119
119
120
120
nosecPackage := testutils .NewTestPackage ()
@@ -131,7 +131,7 @@ var _ = Describe("Analyzer", func() {
131
131
It ("should not report errors when an exclude comment is present for the correct rule" , func () {
132
132
// Rule for MD5 weak crypto usage
133
133
sample := testutils .SampleCodeG401 [0 ]
134
- source := sample .Code
134
+ source := sample .Code [ 0 ]
135
135
analyzer .LoadRules (rules .Generate (rules .NewRuleFilter (false , "G401" )).Builders ())
136
136
137
137
nosecPackage := testutils .NewTestPackage ()
@@ -148,7 +148,7 @@ var _ = Describe("Analyzer", func() {
148
148
It ("should report errors when an exclude comment is present for a different rule" , func () {
149
149
// Rule for MD5 weak crypto usage
150
150
sample := testutils .SampleCodeG401 [0 ]
151
- source := sample .Code
151
+ source := sample .Code [ 0 ]
152
152
analyzer .LoadRules (rules .Generate (rules .NewRuleFilter (false , "G401" )).Builders ())
153
153
154
154
nosecPackage := testutils .NewTestPackage ()
@@ -165,7 +165,7 @@ var _ = Describe("Analyzer", func() {
165
165
It ("should not report errors when an exclude comment is present for multiple rules, including the correct rule" , func () {
166
166
// Rule for MD5 weak crypto usage
167
167
sample := testutils .SampleCodeG401 [0 ]
168
- source := sample .Code
168
+ source := sample .Code [ 0 ]
169
169
analyzer .LoadRules (rules .Generate (rules .NewRuleFilter (false , "G401" )).Builders ())
170
170
171
171
nosecPackage := testutils .NewTestPackage ()
@@ -181,7 +181,7 @@ var _ = Describe("Analyzer", func() {
181
181
182
182
It ("should pass the build tags" , func () {
183
183
sample := testutils .SampleCode601 [0 ]
184
- source := sample .Code
184
+ source := sample .Code [ 0 ]
185
185
analyzer .LoadRules (rules .Generate ().Builders ())
186
186
pkg := testutils .NewTestPackage ()
187
187
defer pkg .Close ()
@@ -197,7 +197,7 @@ var _ = Describe("Analyzer", func() {
197
197
198
198
// Rule for MD5 weak crypto usage
199
199
sample := testutils .SampleCodeG401 [0 ]
200
- source := sample .Code
200
+ source := sample .Code [ 0 ]
201
201
202
202
// overwrite nosec option
203
203
nosecIgnoreConfig := gosec .NewConfig ()
0 commit comments