1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 12:32:21 +00:00
This commit is contained in:
Xargin 2018-07-10 11:08:36 +08:00
parent a77de3ad07
commit 1ad9ab9d99

View File

@ -207,8 +207,9 @@ func checkMachineID(machineID uint16) bool {
func main() {
t, _ := time.Parse("2006-01-02", "2018-01-01")
settings := sonyflake.Settings{
StartTime: t,
MachineID: getMachineID,
StartTime: t,
MachineID: getMachineID,
CheckMachineID: checkMachineID,
}
sf := sonyflake.NewSonyflake(settings)
@ -220,4 +221,5 @@ func main() {
fmt.Println(id)
}
```
```