Skip to content

Commit

Permalink
fix: clean up variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
faiq committed Jan 4, 2024
1 parent f335e7a commit cf34f59
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,13 @@ func validateAndSanitizePrismCentralInfoAddress(address string) (string, error)
}

func parseIP(s string) (string, error) {
ip, _, err := net.SplitHostPort(s)
ipStr, _, err := net.SplitHostPort(s)
if err == nil {
return ip, nil
return ipStr, nil
}

ip2 := net.ParseIP(s)
if ip2 == nil {
return "", fmt.Errorf("invalid IP %s", ip2)
ip := net.ParseIP(s)
if ip == nil {
return "", fmt.Errorf("invalid IP %s", ip)

Check warning on line 244 in pkg/client/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/client.go#L242-L244

Added lines #L242 - L244 were not covered by tests
}

return ip2.String(), nil
return ip.String(), nil

Check warning on line 246 in pkg/client/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/client.go#L246

Added line #L246 was not covered by tests
}

0 comments on commit cf34f59

Please sign in to comment.