diff --git a/testutils/g115_samples.go b/testutils/g115_samples.go index 0f33b26..29f992f 100644 --- a/testutils/g115_samples.go +++ b/testutils/g115_samples.go @@ -176,6 +176,36 @@ func main() { ` package main +import ( + "fmt" +) + +func main() { + var a byte = '\xff' + b := int64(a) + fmt.Println(b) +} + `, + }, 0, gosec.NewConfig()}, + {[]string{ + ` +package main + +import ( + "fmt" +) + +func main() { + var a int8 = -1 + b := int64(a) + fmt.Println(b) +} + `, + }, 0, gosec.NewConfig()}, + {[]string{ + ` +package main + import ( "fmt" "math" @@ -187,6 +217,21 @@ func main() { var a uint = math.MaxUint b := CustomType(a) fmt.Println(b) +} + `, + }, 1, gosec.NewConfig()}, + {[]string{ + ` +package main + +import ( + "fmt" +) + +func main() { + a := []int{1,2,3} + b := uint32(len(a)) + fmt.Println(b) } `, }, 1, gosec.NewConfig()},