mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
main: generate 64bit id
This commit is contained in:
parent
c4e7432ef9
commit
18d95b336f
4
main.go
4
main.go
@ -41,9 +41,9 @@ func main() {
|
|||||||
serve("etcd", config.BindAddr, config.EtcdTLSInfo(), corsInfo, e)
|
serve("etcd", config.BindAddr, config.EtcdTLSInfo(), corsInfo, e)
|
||||||
}
|
}
|
||||||
|
|
||||||
func genId() int {
|
func genId() int64 {
|
||||||
r := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
|
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) {
|
func serve(who string, addr string, tinfo *config.TLSInfo, cinfo *ehttp.CORSInfo, handler http.Handler) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user