fix wrong func name
This commit is contained in:
parent
cb510e0650
commit
4bc781a015
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user