mirror of
https://github.com/securego/gosec.git
synced 2025-11-23 22:15:04 +02:00
Add test to conver unit parssing for G115 rule (#1293)
Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
This commit is contained in:
@@ -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()},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user