mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-09 16:35:12 +00:00
18 lines
316 B
Go
18 lines
316 B
Go
package moreatomic
|
|
|
|
import (
|
|
"sync/atomic"
|
|
|
|
"github.com/diamondburned/arikawa/v2/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))
|
|
}
|