1
0
mirror of synced 2025-12-23 05:28:01 +08:00

exportNextId

This commit is contained in:
yitter
2021-04-03 17:20:01 +08:00
parent 046880ca8f
commit 9c34748c52
3 changed files with 9 additions and 6 deletions

View File

@@ -8,13 +8,13 @@ import (
"yitidgen/regworkerid"
)
///export SetOptions
//export SetOptions
func SetOptions(workerId uint16) {
var options = idgen.NewIdGeneratorOptions(workerId)
idgen.SetIdGenerator(options)
}
///export NextId
//export NextId
func NextId() uint64 {
return idgen.NextId()
}
@@ -65,5 +65,6 @@ func main() {
}
// go build -o target\yitidgengo.dll -buildmode=c-shared main.go
// go build -o ./target/yitidgengo.dll -buildmode=c-shared main.go
// go install -buildmode=shared -linkshared std
// go build -o ./target/yitidgengo.so -buildmode=c-shared main.go