1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00
revive/testdata/golint/increment-decrement.go

15 lines
250 B
Go

// Test for use of x++ and x--.
// Package pkg ...
package pkg
func addOne(x int) int {
x += 1 // MATCH /should replace x += 1 with x++/
return x
}
func subOneInLoop(y int) {
for ; y > 0; y -= 1 { // MATCH /should replace y -= 1 with y--/
}
}