github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/testdata/golint/increment-decrement.go (about)

     1  // Test for use of x++ and x--.
     2  
     3  // Package pkg ...
     4  package pkg
     5  
     6  func addOne(x int) int {
     7  	x += 1 // MATCH /should replace x += 1 with x++/
     8  	return x
     9  }
    10  
    11  func subOneInLoop(y int) {
    12  	for ; y > 0; y -= 1 { // MATCH /should replace y -= 1 with y--/
    13  	}
    14  }