lnd: partially fix golint warnings

This commit is contained in:
Andrey Samokhvalov
2017-02-23 22:56:47 +03:00
committed by Olaoluwa Osuntokun
parent 92dec2a902
commit fd97a4bd19
38 changed files with 229 additions and 233 deletions

View File

@@ -63,9 +63,9 @@ func (e *element) derive(toIndex index) (*element, error) {
}
// isEqual returns true if two elements are identical and false otherwise.
func (first *element) isEqual(second *element) bool {
return (first.index == second.index) &&
(&first.hash).IsEqual(&second.hash)
func (e *element) isEqual(e2 *element) bool {
return (e.index == e2.index) &&
(&e.hash).IsEqual(&e2.hash)
}
const (

View File

@@ -18,7 +18,7 @@ func bitsToIndex(bs ...uint64) (index, error) {
" 64")
}
var res uint64 = 0
var res uint64
for i, e := range bs {
if e != 1 && e != 0 {
return 0, errors.New("wrong element, should be '0' or" +

View File

@@ -45,7 +45,7 @@ func getPrefix(index index, position uint8) uint64 {
// | 0 | 1 | 1 | 1 |
// + -- + ----- + ---- + ------ +
var zero uint64 = 0
var zero uint64
mask := (zero - 1) - uint64((1<<position)-1)
return (uint64(index) & mask)
}
@@ -53,7 +53,7 @@ func getPrefix(index index, position uint8) uint64 {
// countTrailingZeros count number of of trailing zero bits, this function is
// used to determine the number of element bucket.
func countTrailingZeros(index index) uint8 {
var zeros uint8 = 0
var zeros uint8
for ; zeros < maxHeight; zeros++ {
if getBit(index, zeros) != 0 {