package main import ( "log" "os/exec" "git.trj.tw/golang/go-geoip/module/geoip" "git.trj.tw/golang/go-geoip/routes/routes" ) func main() { downloadGeoDB() // init geodb db, err := geoip.NewReader() if err != nil { log.Fatal(err) } defer db.Close() // init gin engine := routes.NewEngine() routes.RegRoutes(engine) engine.Run(":10230") } func downloadGeoDB() { cmd := exec.Command("/usr/bin/download-geodb.sh") err := cmd.Run() if err != nil { log.Printf("command run fail:: %v \n", err) } }