Skip to content

Commit

Permalink
Add test to conver unit parssing for G115 rule
Browse files Browse the repository at this point in the history
Change-Id: I2e1cbbbe9e55fc3547db5b368737562078fd342a
Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
  • Loading branch information
ccojocar committed Jan 23, 2025
1 parent 59291a0 commit 49c3a4b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions testutils/g115_samples.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,4 +843,23 @@ func main() {
}
`,
}, 1, gosec.NewConfig()},
{[]string{
`
package main
import (
"fmt"
"strconv"
)
func main() {
a, err := strconv.ParseUint("100", 10, 16)
if err != nil {
panic("parse error")
}
b := uint16(a)
fmt.Printf("%d\n", b)
}
`,
}, 0, gosec.NewConfig()},
}

0 comments on commit 49c3a4b

Please sign in to comment.