Skip to content

Commit

Permalink
Resolve Go linter findings
Browse files Browse the repository at this point in the history
  • Loading branch information
byronwolfman committed Sep 19, 2024
1 parent d5d3869 commit 80031e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions client/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package client

import (
"bufio"
"fmt"
"errors"
"log"
"net"
"sync"
Expand All @@ -23,7 +23,7 @@ const (
)

var (
clientClosed = fmt.Errorf("client closed")
clientClosed = errors.New("client closed")
)

type seqCallback struct {
Expand Down Expand Up @@ -453,7 +453,7 @@ func (mh *monitorHandler) Cleanup() {
if !mh.closed {
if !mh.init {
mh.init = true
mh.initCh <- fmt.Errorf("Stream closed")
mh.initCh <- errors.New("Stream closed")
}
if mh.logCh != nil {
close(mh.logCh)
Expand Down Expand Up @@ -535,7 +535,7 @@ func (sh *streamHandler) Cleanup() {
if !sh.closed {
if !sh.init {
sh.init = true
sh.initCh <- fmt.Errorf("Stream closed")
sh.initCh <- errors.New("Stream closed")
}
if sh.eventCh != nil {
close(sh.eventCh)
Expand Down Expand Up @@ -636,7 +636,7 @@ func (qh *queryHandler) Cleanup() {
if !qh.closed {
if !qh.init {
qh.init = true
qh.initCh <- fmt.Errorf("Stream closed")
qh.initCh <- errors.New("Stream closed")
}
if qh.ackCh != nil {
close(qh.ackCh)
Expand Down Expand Up @@ -788,7 +788,7 @@ func (c *RPCClient) genericRPC(header *requestHeader, req interface{}, resp inte
// strToError converts a string to an error if not blank
func strToError(s string) error {
if s != "" {
return fmt.Errorf(s)
return errors.New(s)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/serf/command/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (s StatsContainer) String() string {

// Iterate over each top-level key
for _, key := range keys {
buf.WriteString(fmt.Sprintf(key + ":\n"))
buf.WriteString(fmt.Sprintf("%s:\n", key))

// Sort the sub-keys
subvals := s[key]
Expand Down

0 comments on commit 80031e4

Please sign in to comment.