This repository has been archived on 2023-12-12. You can view files and clone it, but cannot push or open issues or pull requests.
alidns/getip_test.go

19 lines
250 B
Go
Raw Permalink Normal View History

2022-04-03 10:46:51 +08:00
package main
import (
"fmt"
"net"
"testing"
)
func TestGtPubIp(t *testing.T) {
ip := getPubIp()
if net.ParseIP(ip) == nil {
fmt.Printf("IP Address: %s - Invalid\n", ip)
t.Fail()
} else {
fmt.Printf("IP Address: %s - Valid\n", ip)
}
}