Add test to conver unit parssing for G115 rule (#1293)

Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
This commit is contained in:
Cosmin Cojocar 2025-01-23 14:22:32 +01:00 committed by GitHub
parent 59291a08ae
commit c66cb56f09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -843,4 +843,23 @@ func main() {
} }
`, `,
}, 1, gosec.NewConfig()}, }, 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()},
} }