mirror of
https://github.com/securego/gosec.git
synced 2025-02-28 12:13:29 +00:00
Add test to conver unit parssing for G115 rule (#1293)
Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
This commit is contained in:
parent
59291a08ae
commit
c66cb56f09
1 changed files with 19 additions and 0 deletions
|
@ -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()},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue