Skip to content

Commit

Permalink
Use switch
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuki committed Mar 4, 2018
1 parent 2374cdc commit eec0997
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conntrack/conntrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ func (f *HostFlow) HasDirection(dire FlowDirection) bool {

// String returns the string representation of HostFlow.
func (f *HostFlow) String() string {
if f.direction == FlowActive {
switch f.direction {
case FlowActive:
return fmt.Sprintf("localhost:many\t --> \t%s:%s \t%s", f.addr, f.port, f.stat)
} else if f.direction == FlowPassive {
case FlowPassive:
return fmt.Sprintf("localhost:%s\t <-- \t%s:many \t%s", f.port, f.addr, f.stat)
}
return ""
Expand Down

0 comments on commit eec0997

Please sign in to comment.