1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-08-31 10:57:24 +00:00
arikawa/internal/moreatomic/snowflake.go
2023-08-04 14:24:50 -07:00

18 lines
300 B
Go

package moreatomic
import (
"sync/atomic"
"libdb.so/arikawa/v4/discord"
)
type Snowflake int64
func (s *Snowflake) Get() discord.Snowflake {
return discord.Snowflake(atomic.LoadInt64((*int64)(s)))
}
func (s *Snowflake) Set(id discord.Snowflake) {
atomic.StoreInt64((*int64)(s), int64(id))
}