nums[1] sum += nums[2] sum += nums[3] sum += nums[4] return sum } func f2(nums []int) int { sum := nums[4] sum += nums[3] sum += nums[2] sum += nums[1] sum += nums[0] return sum } どちらもスライスの要素を足し合わせる処理
./main.go:12:13: Found IsInBounds ./main.go:13:13: Found IsInBounds ./main.go:14:13: Found IsInBounds ./main.go:15:13: Found IsInBounds ./main.go:20:13: Found IsInBounds
IsInBounds sum += nums[1] # Found IsInBounds sum += nums[2] # Found IsInBounds sum += nums[3] # Found IsInBounds sum += nums[4] # Found IsInBounds return sum } func f2(nums []int) int { sum := nums[4] # Found IsInBounds sum += nums[3] sum += nums[2] sum += nums[1] sum += nums[0] return sum }
IsInBounds sum += nums[1] # Found IsInBounds sum += nums[2] # Found IsInBounds sum += nums[3] # Found IsInBounds sum += nums[4] # Found IsInBounds return sum } func f2(nums []int) int { sum := nums[4] # Found IsInBounds sum += nums[3] sum += nums[2] sum += nums[1] sum += nums[0] return sum } IsInBounds (IsSliceInBounds) ... Bounds Checkが必要