Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: Disable 'ifElseChain' gocritic check #149

Merged
merged 3 commits into from Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
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
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
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