mirror of
https://github.com/sony/sonyflake.git
synced 2026-11-16 07:46:30 +00:00
Merge pull request #3 from yuokada/feature/grcard
Fix ineffassign error
This commit is contained in:
commit
fa881fb105
2 files changed
+4
No files matched your search
@@ -4,6 +4,7 @@ Sonyflake
|
|||||||
[](http://godoc.org/github.com/sony/sonyflake)
|
[](http://godoc.org/github.com/sony/sonyflake)
|
||||||
[](https://travis-ci.org/sony/sonyflake)
|
[](https://travis-ci.org/sony/sonyflake)
|
||||||
[](https://coveralls.io/github/sony/sonyflake?branch=master)
|
[](https://coveralls.io/github/sony/sonyflake?branch=master)
|
||||||
|
[](https://goreportcard.com/report/github.com/sony/sonyflake)
|
||||||
|
|
||||||
Sonyflake is a distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake).
|
Sonyflake is a distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake).
|
||||||
A Sonyflake ID is composed of
|
A Sonyflake ID is composed of
|
||||||
|
|||||||
@@ -57,5 +57,8 @@ func TimeDifference(server string) (time.Duration, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
f, err := strconv.ParseFloat(string(submatched[1]), 64)
|
f, err := strconv.ParseFloat(string(submatched[1]), 64)
|
||||||
|
if err != nil {
|
||||||
|
return time.Duration(0), err
|
||||||
|
}
|
||||||
return time.Duration(f*1000) * time.Millisecond, nil
|
return time.Duration(f*1000) * time.Millisecond, nil
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user