Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 5ab5031

Browse files
committed
fix error-prone way to access Threat fields
1 parent dfdc7d3 commit 5ab5031

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/requests/resources.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ func getRules(options *common.Options) {
4747
for i := 0; i < len(rsrc.Threat); i++ {
4848
exclude = false
4949
threat := reflect.ValueOf(&rsrc.Threat[i]).Elem()
50-
fname := threat.FieldByName("Filename").String()
51-
cat := threat.FieldByName("Category").String()
50+
fname := rsrc.Threat[i].Filename
51+
cat := rsrc.Threat[i].Category
5252

5353
for x := 0; x < len(excludes); x++ {
5454
if excludes[x] == cat {

0 commit comments

Comments
 (0)