1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00
revive/fixtures/increment-decrement.go
2018-01-25 11:16:28 -08:00

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--/
}
}