github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/golint/testdata/inc.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 /x\+\+/
     8  	return x
     9  }
    10  
    11  func subOneInLoop(y int) {
    12  	for ; y > 0; y -= 1 { // MATCH /y--/
    13  	}
    14  }