1
0
mirror of synced 2025-12-26 15:07:57 +08:00

forbid calling NextId method first

This commit is contained in:
yitter
2022-07-18 18:32:30 +08:00
parent 396a6fc6a5
commit 1fb780d634
3 changed files with 11 additions and 6 deletions

View File

@@ -32,7 +32,9 @@ func NextId() int64 {
// idGenerator = NewDefaultIdGenerator(options)
// }
//}
if idGenerator == nil {
panic("Please initialize Yitter.IdGeneratorOptions first.")
}
return idGenerator.NewLong()
}