Remove NewSonyflake

This commit is contained in:
Yoshiyuki Mineo committed 2025-05-02 02:42:07 +09:00
1 parent c847588763
commit 313db86c15
3 files changed
+9 -14

No files matched your search

+6 -1
View File
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"log"
"net/http"
"github.com/sony/sonyflake/v2"
@@ -13,7 +14,11 @@ var sf *sonyflake.Sonyflake
func init() {
var st sonyflake.Settings
st.MachineID = awsutil.AmazonEC2MachineID
sf = sonyflake.NewSonyflake(st)
var err error
sf, err = sonyflake.New(st)
if err != nil {
log.Fatal(err)
}
if sf == nil {
panic("sonyflake not created")
}