Skip to content

Commit

Permalink
Satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
PapaCharlie committed Oct 2, 2024
1 parent 0653daf commit be96c7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ads/ads.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ func LookupStreamTypeByRPCMethod(rpcMethod string) (StreamType, bool) {
}

var (
invalidNonceEncodingErr = errors.New("nonce isn't in hex encoding")
invalidNonceLengthErr = errors.New("decoded nonce did not have expected length")
errInvalidNonceEncoding = errors.New("nonce isn't in hex encoding")
errInvalidNonceLength = errors.New("decoded nonce did not have expected length")
)

// ParseRemainingChunksFromNonce checks whether the Diderot server implementation chunked the delta
Expand All @@ -276,11 +276,11 @@ var (
func ParseRemainingChunksFromNonce(nonce string) (remainingChunks int, err error) {
decoded, err := hex.DecodeString(nonce)
if err != nil {
return 0, invalidNonceEncodingErr
return 0, errInvalidNonceEncoding
}

if len(decoded) != 12 {
return 0, invalidNonceLengthErr
return 0, errInvalidNonceLength
}

return int(binary.BigEndian.Uint32(decoded[8:12])), nil
Expand Down

0 comments on commit be96c7c

Please sign in to comment.