common: all golint warnings removed (#16852)

* common: all golint warnings removed

* common: fixups
This commit is contained in:
kiel barry 2018-06-14 02:52:50 -07:00 committed by Péter Szilágyi
parent cfde0b5f52
commit d0fd8d6fc2
6 changed files with 14 additions and 8 deletions

View File

@ -39,6 +39,7 @@ import (
const uintBits = 32 << (uint64(^uint(0)) >> 63)
// Errors
var (
ErrEmptyString = &decError{"empty hex string"}
ErrSyntax = &decError{"invalid hex string"}

View File

@ -22,12 +22,13 @@ import (
"math/big"
)
// Various big integer limit values.
var (
tt255 = BigPow(2, 255)
tt256 = BigPow(2, 256)
tt256m1 = new(big.Int).Sub(tt256, big.NewInt(1))
MaxBig256 = new(big.Int).Set(tt256m1)
tt63 = BigPow(2, 63)
MaxBig256 = new(big.Int).Set(tt256m1)
MaxBig63 = new(big.Int).Sub(tt63, big.NewInt(1))
)

View File

@ -21,8 +21,8 @@ import (
"strconv"
)
// Integer limit values.
const (
// Integer limit values.
MaxInt8 = 1<<7 - 1
MinInt8 = -1 << 7
MaxInt16 = 1<<15 - 1

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// package mclock is a wrapper for a monotonic clock source
// Package mclock is a wrapper for a monotonic clock source
package mclock
import (
@ -23,8 +23,10 @@ import (
"github.com/aristanetworks/goarista/monotime"
)
type AbsTime time.Duration // absolute monotonic time
// AbsTime represents absolute monotonic time.
type AbsTime time.Duration
// Now returns the current absolute monotonic time.
func Now() AbsTime {
return AbsTime(monotime.Now())
}

View File

@ -22,9 +22,11 @@ import (
"github.com/ethereum/go-ethereum/common"
)
var tt256 = new(big.Int).Lsh(big.NewInt(1), 256)
var tt256m1 = new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(1))
var tt255 = new(big.Int).Lsh(big.NewInt(1), 255)
var (
tt256 = new(big.Int).Lsh(big.NewInt(1), 256)
tt256m1 = new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(1))
tt255 = new(big.Int).Lsh(big.NewInt(1), 255)
)
func limitUnsigned256(x *Number) *Number {
x.num.And(x.num, tt256m1)
@ -181,7 +183,6 @@ func (i *Number) FirstBitSet() int {
}
// Variables
var (
Zero = Uint(0)
One = Uint(1)

View File

@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/crypto/sha3"
)
// Lengths of hashes and addresses in bytes.
const (
HashLength = 32
AddressLength = 20