Skip to content

Commit

Permalink
Merge pull request #149 from SiaFoundation/ifelse
Browse files Browse the repository at this point in the history
lint: Disable 'ifElseChain' gocritic check
  • Loading branch information
lukechampine committed Mar 30, 2024
2 parents e781eaa + 097e517 commit 1ae0547
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ linters-settings:
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
# By default list of stable checks is used.
disable-all: true
enabled-checks:
- argOrder # Diagnostic options
- badCond
Expand Down
2 changes: 1 addition & 1 deletion types/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (p SpendPolicy) String() string {
if i > 0 {
sb.WriteByte(',')
}
writeHex(pk.Key[:])
writeHex(pk.Key)
}
sb.WriteString("],")
sb.WriteString(strconv.FormatUint(uint64(p.SignaturesRequired), 10))
Expand Down
4 changes: 2 additions & 2 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ func (b *Block) ID() BlockID {
// Implementations of fmt.Stringer, encoding.Text(Un)marshaler, and json.(Un)marshaler

func stringerHex(prefix string, data []byte) string {
return prefix + ":" + hex.EncodeToString(data[:])
return prefix + ":" + hex.EncodeToString(data)
}

func marshalHex(prefix string, data []byte) ([]byte, error) {
Expand Down Expand Up @@ -897,7 +897,7 @@ func (s *Specifier) UnmarshalText(b []byte) error {

// MarshalText implements encoding.TextMarshaler.
func (uk UnlockKey) MarshalText() ([]byte, error) {
return marshalHex(uk.Algorithm.String(), uk.Key[:])
return marshalHex(uk.Algorithm.String(), uk.Key)
}

// UnmarshalText implements encoding.TextUnmarshaler.
Expand Down

0 comments on commit 1ae0547

Please sign in to comment.