package main import ( "fmt" "github.com/bwmarrin/snowflake" ) func main() { // Create a new Node with a Node number of 1 node, err := snowflake.NewNode(1) if err != nil { fmt.Println(err) return } // Generate a snowflake ID. id := node.Generate() json, _ := id.MarshalJSON() fmt.Println(string(json)) }