正常获取IP信息 tt.mockHttpGetFunc is nil: false
正常获取IP信息 tt.mockReadAllFunc is nil: false
ioReadAll 192.168.0.1 <nil>
http.Get错误 tt.mockHttpGetFunc is nil: false
http.Get错误 tt.mockReadAllFunc is nil: true
请求发生错误: http get error
io.ReadAll错误 tt.mockHttpGetFunc is nil: false
io.ReadAll错误 tt.mockReadAllFunc is nil: false
ioReadAll 192.168.0.1 <nil>
--- FAIL: TestGetIp (0.00s)
--- FAIL: TestGetIp/io.ReadAll错误 (0.00s)
http_request_test.go:66: GetIp() = 192.168.0.1, expect
FAIL
exit status 1
FAIL godemo/test/http_request 0.005s
--------------------------------------------------------------
正常获取IP信息 tt.mockHttpGetFunc is nil: false
正常获取IP信息 tt.mockReadAllFunc is nil: false
ioReadAll 192.168.0.1 <nil>
http.Get错误 tt.mockHttpGetFunc is nil: false
http.Get错误 tt.mockReadAllFunc is nil: true
ioReadAll 192.168.0.1 <nil>
io.ReadAll错误 tt.mockHttpGetFunc is nil: false
io.ReadAll错误 tt.mockReadAllFunc is nil: false
ioReadAll 192.168.0.1 <nil>
--- FAIL: TestGetIp (0.00s)
--- FAIL: TestGetIp/http.Get错误 (0.00s)
http_request_test.go:66: GetIp() = 192.168.0.1, expect
--- FAIL: TestGetIp/io.ReadAll错误 (0.00s)
http_request_test.go:66: GetIp() = 192.168.0.1, expect
FAIL
exit status 1
FAIL godemo/test/http_request 0.006s
result expect
正常获取IP信息 tt.mockHttpGetFunc is nil: false
正常获取IP信息 tt.mockReadAllFunc is nil: false
ioReadAll 192.168.0.1 <nil>
http.Get错误 tt.mockHttpGetFunc is nil: false
http.Get错误 tt.mockReadAllFunc is nil: true
请求发生错误: http get error
io.ReadAll错误 tt.mockHttpGetFunc is nil: false
io.ReadAll错误 tt.mockReadAllFunc is nil: false
ioReadAll read all error
读取响应数据发生错误: read all error
PASS
ok godemo/test/http_request 0.005s
Behaviors:
file1: http_request.go
file2:http_request_test.go
test command
result unexpect
result expect