Skip to content

Commit

Permalink
fix: Fix lint errors in types/bech32
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d committed Sep 10, 2021
1 parent 4f289b2 commit 356f918
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions types/bech32/bech32.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)
for _, b := range data {

// Discard unused bits.
b = b << (8 - fromBits)
b <<= (8 - fromBits)

// How many bits remaining to extract from the input data.
remFromBits := fromBits
Expand All @@ -325,7 +325,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)

// Discard the bits we just extracted and get ready for
// next iteration.
b = b << toExtract
b <<= toExtract
remFromBits -= toExtract
filledBits += toExtract

Expand All @@ -341,7 +341,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)

// We pad any unfinished group if specified.
if pad && filledBits > 0 {
nextByte = nextByte << (toBits - filledBits)
nextByte <<= (toBits - filledBits)
regrouped = append(regrouped, nextByte)
filledBits = 0
nextByte = 0
Expand Down

0 comments on commit 356f918

Please sign in to comment.