8 func TestExternalIPv4(t *testing.T) {
9 // Regular expression format for IPv4
10 IPv4Format := `\.\d{1,3}\.\d{1,3}\b`
11 test, err := ExternalIPv4()
14 t.Errorf("Test check external ipv4 failed with %v", err)
17 valid := regexp.MustCompile(IPv4Format)
19 if !valid.MatchString(test) {
20 t.Errorf("Wanted: %v, got: %v", IPv4Format, test)