diff --git a/machine.go b/machine.go index cae5c68c..3ddf471c 100644 --- a/machine.go +++ b/machine.go @@ -155,7 +155,7 @@ func (machine *Machine) isOnline() bool { func containsAddresses(inputs []string, addrs []string) bool { for _, addr := range addrs { - if contains(inputs, addr) { + if containsStr(inputs, addr) { return true } } diff --git a/utils.go b/utils.go index 8bdb2b3f..5d7f4872 100644 --- a/utils.go +++ b/utils.go @@ -269,6 +269,16 @@ func stringToIPPrefix(prefixes []string) ([]netip.Prefix, error) { return result, nil } +func containsStr(ts []string, t string) bool { + for _, v := range ts { + if v == t { + return true + } + } + + return false +} + func contains[T string | netip.Prefix](ts []T, t T) bool { for _, v := range ts { if reflect.DeepEqual(v, t) {