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

Feat/fix staticcheck #254

Closed
wants to merge 2 commits into from

Conversation

coryschwartz
Copy link
Contributor

err := p.Validate()
if err != nil {
return nil, err
}

if p == s.local {
log.Event(ctx, "swarmDialSelf", logdial)
// log.Event(ctx, "swarmDialSelf", logdial)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien, how are we supposed to deal with this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log.Debugw with a message.

return nil, ErrDialToSelf
}

defer log.EventBegin(ctx, "swarmDialAttemptSync", p).Done()
// defer log.EventBegin(ctx, "swarmDialAttemptSync", p).Done()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just delete these lines.

@@ -111,7 +111,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
// ignore.
return
default:
log.Warningf("add conn %s failed: ", err)
log.Warnf("add conn %s failed: ", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're changing these, we might as well switch to a structured version:

log.Warnw("adding connection failed", "to", p, "error", err)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #255.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants