Commit 5c3c0a05 authored by vyzo's avatar vyzo

more idiomatic code

parent 98c7c00c
...@@ -202,8 +202,7 @@ func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn, ...@@ -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 // create the Stat object, initializing with the underlying connection Stat if available
var stat network.Stat var stat network.Stat
cs, ok := tc.(network.ConnStat) if cs, ok := tc.(network.ConnStat); ok {
if ok {
stat = cs.Stat() stat = cs.Stat()
} }
stat.Direction = dir stat.Direction = dir
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment