Skip to content

Commit

Permalink
remove extra if clause
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Nov 6, 2023
1 parent 631fcf7 commit a3daf2c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions links/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,9 @@ func extractHostNodeInterfaceData(lb *LinkBriefRaw, specialEPIndex int) (host, h
hostData := strings.SplitN(lb.Endpoints[specialEPIndex], ":", 2)
nodeData := strings.SplitN(lb.Endpoints[nodeindex], ":", 2)

if len(hostData) != 2 {
return "", "", "", "", fmt.Errorf("invalid link endpoint format. expected is <node>:<port>, got %s", lb.Endpoints[specialEPIndex])
}
if len(nodeData) != 2 {
return "", "", "", "", fmt.Errorf("invalid link endpoint format. expected is <node>:<port>, got %s", lb.Endpoints[specialEPIndex])
if len(hostData) != 2 || len(nodeData) != 2 {
return "", "", "", "",
fmt.Errorf("invalid link endpoint format. expected <node>:<port>, got %s", lb.Endpoints[specialEPIndex])
}

host = hostData[0]
Expand Down

0 comments on commit a3daf2c

Please sign in to comment.