-
Notifications
You must be signed in to change notification settings - Fork 0
/
extip_test.go
executable file
·54 lines (47 loc) · 1.07 KB
/
extip_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package extip
import (
"fmt"
"testing"
)
func TestGetIP(t *testing.T) {
address, err := GetIP()
if err != nil {
t.Errorf("Error: %s", err)
}
fmt.Printf("GetIP: %s\n", address)
}
func TestGetPort(t *testing.T) {
port, err := GetPort()
if err != nil {
t.Errorf("Error: %s", err)
}
fmt.Printf("GetPort: %d\n", port)
}
func TestGetIP4(t *testing.T) {
address, err := GetIP4()
if err != nil {
t.Errorf("Error: %s", err)
}
fmt.Printf("GetIP4: %s\n", address)
}
func TestGetPort4(t *testing.T) {
port4, err := GetPort4()
if err != nil {
t.Errorf("Error: %s", err)
}
fmt.Printf("GetPort4: %d\n", port4)
}
func TestGetIP6(t *testing.T) {
address, err := GetIP6()
if err != nil {
t.Errorf("Error: %s", err)
}
fmt.Printf("GetIP6: %s\n", address)
}
func TestGetPort6(t *testing.T) {
port6, err := GetPort6()
if err != nil {
t.Errorf("Error: %s", err)
}
fmt.Printf("GetPort6: %d\n", port6)
}