diff --git a/src/geoip/main.go b/src/geoip/main.go index 93c9e6c..12bbbda 100644 --- a/src/geoip/main.go +++ b/src/geoip/main.go @@ -7,6 +7,7 @@ import ( "log" "net/http" "os" + "sort" "strings" geoip2 "github.com/oschwald/geoip2-golang" @@ -31,7 +32,14 @@ func GetLastVersion() string { if err != nil { log.Println(err) } - return apiresults[0].Tag + + var tags []string + for _, t := range apiresults { + tags = append(tags, t.Tag) + } + sort.Sort(sort.Reverse(sort.StringSlice(tags))) + + return tags[0] } func InitGeoIP() (citydb *geoip2.Reader, asndb *geoip2.Reader, err error) {