From 4bc781a015289a5469d079e4f91147ccab2465fb Mon Sep 17 00:00:00 2001 From: pengtao Date: Thu, 26 Nov 2020 15:48:30 +0800 Subject: [PATCH] fix wrong func name --- client/client.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/client/client.go b/client/client.go index 9820376..922df56 100644 --- a/client/client.go +++ b/client/client.go @@ -1,24 +1,25 @@ package main import ( - "../cmd/httpclient" "encoding/json" "fmt" - "github.com/Unknwon/goconfig" - "github.com/fatih/structs" "io/ioutil" "log" "net" "net/http" "os" "time" + + "../cmd/httpclient" + "github.com/Unknwon/goconfig" + "github.com/fatih/structs" ) func init() { // } -func getLocalIp() string { +func getLocalIP() string { addrs, err := net.InterfaceAddrs() if err != nil { fmt.Println(err) @@ -36,11 +37,11 @@ func getLocalIp() string { return "" } -func checkUrl(list *httpclient.List) *httpclient.Status { +func checkURL(list *httpclient.List) *httpclient.Status { var s httpclient.Status s.Area = list.Area s.Id = list.Id - s.Ip = getLocalIp() + s.Ip = getLocalIP() t1 := time.Now() _, err := http.Get(list.Url) if err != nil { @@ -91,7 +92,7 @@ func main() { fmt.Println("error", err) } else { for _, v := range dat { - ss := checkUrl(&v) + ss := checkURL(&v) vv = append(vv, ss) } }