Compare commits
1 Commits
v20220306.
...
v20220306.
Author | SHA1 | Date | |
---|---|---|---|
5821d890b8 |
4
main.go
4
main.go
@ -9,6 +9,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,7 +20,8 @@ func main() {
|
|||||||
servers := getServers()
|
servers := getServers()
|
||||||
bestIndex := selectBestServerIndex(servers)
|
bestIndex := selectBestServerIndex(servers)
|
||||||
log.Debug().Interface("server", servers[bestIndex]).Msg("Best latency server found.")
|
log.Debug().Interface("server", servers[bestIndex]).Msg("Best latency server found.")
|
||||||
fmt.Println(servers[bestIndex].Hostname)
|
hostname := strings.Split(servers[bestIndex].Hostname, "-")[0]
|
||||||
|
fmt.Println(hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
func selectBestServerIndex(servers []server) int {
|
func selectBestServerIndex(servers []server) int {
|
||||||
|
Reference in New Issue
Block a user