Browse Source

main: generate 64bit id

Xiang Li 11 years ago
parent
commit
18d95b336f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      main.go

+ 2 - 2
main.go

@@ -41,9 +41,9 @@ func main() {
 	serve("etcd", config.BindAddr, config.EtcdTLSInfo(), corsInfo, e)
 }
 
-func genId() int {
+func genId() int64 {
 	r := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
-	return r.Int()
+	return r.Int63()
 }
 
 func serve(who string, addr string, tinfo *config.TLSInfo, cinfo *ehttp.CORSInfo, handler http.Handler) {