Skip to content

Commit

Permalink
Add test to conver unit parssing for G115 rule (#1293)
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Cojocar <[email protected]>
  • Loading branch information
ccojocar authored Jan 23, 2025
1 parent 59291a0 commit c66cb56
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 c66cb56

Please sign in to comment.