Skip to content

Commit

Permalink
Remove unnecessary nil check.
Browse files Browse the repository at this point in the history
InterfaceAddrs already checks for nil, making this redundant.

Signed-off-by: Juan-Luis de Sousa-Valadas Castaño <jvaladas@mirantis.com>
  • Loading branch information
juanluisvaladas committed Jan 9, 2025
1 parent b4faabc commit 02a5c41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/iface/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func FirstPublicAddress() (string, error) {
}
for a := range addresses {
// check the address type and skip if loopback
if a != nil && !a.IP.IsLoopback() {
if !a.IP.IsLoopback() {
if a.IP.To4() != nil {
return a.IP.String(), nil
}
Expand Down

0 comments on commit 02a5c41

Please sign in to comment.