Fix lint errors (#190)

* use increment and decrement operators.

* remove unnecessary else branches.

* fix receiver names.

* remove omittable code.

* fix dot imports.
This commit is contained in:
Thomas Corbière
2018-04-03 12:23:28 +02:00
committed by Anton Kaliaev
parent a557bb4d0b
commit ee67e34519
27 changed files with 121 additions and 145 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
package test
import (
. "github.com/tendermint/tmlibs/common"
cmn "github.com/tendermint/tmlibs/common"
)
// Contract: !bytes.Equal(input, output) && len(input) >= len(output)
@@ -17,11 +17,11 @@ func MutateByteSlice(bytez []byte) []byte {
bytez = mBytez
// Try a random mutation
switch RandInt() % 2 {
switch cmn.RandInt() % 2 {
case 0: // Mutate a single byte
bytez[RandInt()%len(bytez)] += byte(RandInt()%255 + 1)
bytez[cmn.RandInt()%len(bytez)] += byte(cmn.RandInt()%255 + 1)
case 1: // Remove an arbitrary byte
pos := RandInt() % len(bytez)
pos := cmn.RandInt() % len(bytez)
bytez = append(bytez[:pos], bytez[pos+1:]...)
}
return bytez