Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

fix staticcheck #103

Merged
merged 1 commit into from
May 5, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autonat.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,5 +443,5 @@ func (s *StaticAutoNAT) PublicAddr() (ma.Multiaddr, error) {
if s.reachability != network.ReachabilityPublic {
return nil, errors.New("NAT status is not public")
}
return nil, errors.New("No available address")
return nil, errors.New("no available address")
}
2 changes: 1 addition & 1 deletion autonat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestAutoNATObservationRecording(t *testing.T) {
}

select {
case _ = <-s.Out():
case <-s.Out():
t.Fatal("not expecting a public reachability event")
default:
//expected
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (c *client) DialBack(ctx context.Context, p peer.ID) (ma.Multiaddr, error)
}

if res.GetType() != pb.Message_DIAL_RESPONSE {
return nil, fmt.Errorf("Unexpected response: %s", res.GetType().String())
return nil, fmt.Errorf("unexpected response: %s", res.GetType().String())
}

status := res.GetDialResponse().GetStatus()
Expand Down
4 changes: 1 addition & 3 deletions dialpolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ type mockL struct {
}

func (l *mockL) Accept() (transport.CapableConn, error) {
select {
case <-l.ctx.Done():
}
<-l.ctx.Done()
return nil, errors.New("expected in mocked test")
}
func (l *mockL) Close() error { return nil }
Expand Down
3 changes: 1 addition & 2 deletions svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type autoNATService struct {
config *config

// rate limiter
running uint32
mx sync.Mutex
reqs map[peer.ID]int
globalReqs int
Expand All @@ -37,7 +36,7 @@ type autoNATService struct {
// NewAutoNATService creates a new AutoNATService instance attached to a host
func newAutoNATService(ctx context.Context, c *config) (*autoNATService, error) {
if c.dialer == nil {
return nil, errors.New("Cannot create NAT service without a network")
return nil, errors.New("cannot create NAT service without a network")
}

as := &autoNATService{
Expand Down