Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to conver unit parssing for G115 rule #1293

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add test to conver unit parssing for G115 rule
Change-Id: I2e1cbbbe9e55fc3547db5b368737562078fd342a
Signed-off-by: Cosmin Cojocar <[email protected]>
ccojocar committed Jan 23, 2025

Verified

This commit was signed with the committer’s verified signature.
sverweij Sander Verweij
commit 49c3a4bf79148903a46d76557d3de2ee68137fb7
19 changes: 19 additions & 0 deletions testutils/g115_samples.go
Original file line number Diff line number Diff line change
@@ -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()},
}