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

Commit

Permalink
more idiomatic code
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Feb 17, 2021
1 parent 98c7c00 commit 5c3c0a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn,

// create the Stat object, initializing with the underlying connection Stat if available
var stat network.Stat
cs, ok := tc.(network.ConnStat)
if ok {
if cs, ok := tc.(network.ConnStat); ok {
stat = cs.Stat()
}
stat.Direction = dir
Expand Down

0 comments on commit 5c3c0a0

Please sign in to comment.