mirror of
https://github.com/sony/sonyflake.git
synced 2026-04-25 10:40:45 +00:00
Merge pull request #3 from yuokada/feature/grcard
Fix ineffassign error
This commit is contained in:
@@ -4,6 +4,7 @@ Sonyflake
|
||||
[](http://godoc.org/github.com/sony/sonyflake)
|
||||
[](https://travis-ci.org/sony/sonyflake)
|
||||
[](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).
|
||||
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)
|
||||
if err != nil {
|
||||
return time.Duration(0), err
|
||||
}
|
||||
return time.Duration(f*1000) * time.Millisecond, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user