Skip to content

Commit c66cb56

Browse files
authoredJan 23, 2025··
Add test to conver unit parssing for G115 rule (#1293)
Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
1 parent 59291a0 commit c66cb56

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
 

‎testutils/g115_samples.go

+19
Original file line numberDiff line numberDiff line change
@@ -843,4 +843,23 @@ func main() {
843843
}
844844
`,
845845
}, 1, gosec.NewConfig()},
846+
{[]string{
847+
`
848+
package main
849+
850+
import (
851+
"fmt"
852+
"strconv"
853+
)
854+
855+
func main() {
856+
a, err := strconv.ParseUint("100", 10, 16)
857+
if err != nil {
858+
panic("parse error")
859+
}
860+
b := uint16(a)
861+
fmt.Printf("%d\n", b)
862+
}
863+
`,
864+
}, 0, gosec.NewConfig()},
846865
}

0 commit comments

Comments
 (0)
Please sign in to comment.