Skip to content

Commit d0fd8d6

Browse files
kielbarrykaralabe
authored andcommitted
common: all golint warnings removed (#16852)
* common: all golint warnings removed * common: fixups
1 parent cfde0b5 commit d0fd8d6

6 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎common/hexutil/hexutil.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939

4040
const uintBits = 32 << (uint64(^uint(0)) >> 63)
4141

42+
// Errors
4243
var (
4344
ErrEmptyString = &decError{"empty hex string"}
4445
ErrSyntax = &decError{"invalid hex string"}

‎common/math/big.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ import (
2222
"math/big"
2323
)
2424

25+
// Various big integer limit values.
2526
var (
2627
tt255 = BigPow(2, 255)
2728
tt256 = BigPow(2, 256)
2829
tt256m1 = new(big.Int).Sub(tt256, big.NewInt(1))
29-
MaxBig256 = new(big.Int).Set(tt256m1)
3030
tt63 = BigPow(2, 63)
31+
MaxBig256 = new(big.Int).Set(tt256m1)
3132
MaxBig63 = new(big.Int).Sub(tt63, big.NewInt(1))
3233
)
3334

‎common/math/integer.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"strconv"
2222
)
2323

24+
// Integer limit values.
2425
const (
25-
// Integer limit values.
2626
MaxInt8 = 1<<7 - 1
2727
MinInt8 = -1 << 7
2828
MaxInt16 = 1<<15 - 1

‎common/mclock/mclock.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
// package mclock is a wrapper for a monotonic clock source
17+
// Package mclock is a wrapper for a monotonic clock source
1818
package mclock
1919

2020
import (
@@ -23,8 +23,10 @@ import (
2323
"github.com/aristanetworks/goarista/monotime"
2424
)
2525

26-
type AbsTime time.Duration // absolute monotonic time
26+
// AbsTime represents absolute monotonic time.
27+
type AbsTime time.Duration
2728

29+
// Now returns the current absolute monotonic time.
2830
func Now() AbsTime {
2931
return AbsTime(monotime.Now())
3032
}

‎common/number/int.go‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ import (
2222
"github.com/ethereum/go-ethereum/common"
2323
)
2424

25-
var tt256 = new(big.Int).Lsh(big.NewInt(1), 256)
26-
var tt256m1 = new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(1))
27-
var tt255 = new(big.Int).Lsh(big.NewInt(1), 255)
25+
var (
26+
tt256 = new(big.Int).Lsh(big.NewInt(1), 256)
27+
tt256m1 = new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 256), big.NewInt(1))
28+
tt255 = new(big.Int).Lsh(big.NewInt(1), 255)
29+
)
2830

2931
func limitUnsigned256(x *Number) *Number {
3032
x.num.And(x.num, tt256m1)
@@ -181,7 +183,6 @@ func (i *Number) FirstBitSet() int {
181183
}
182184

183185
// Variables
184-
185186
var (
186187
Zero = Uint(0)
187188
One = Uint(1)

‎common/types.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/ethereum/go-ethereum/crypto/sha3"
3030
)
3131

32+
// Lengths of hashes and addresses in bytes.
3233
const (
3334
HashLength = 32
3435
AddressLength = 20

0 commit comments

Comments
 (0)