mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-12-02 20:02:53 +00:00
32789bb6e2
* Utils: move package utils/heart to internal/heart * Utils: move package utils/moreatomic to internal/moreatomic * Utils: move package utils/zlib to internal/zlib
18 lines
313 B
Go
18 lines
313 B
Go
package moreatomic
|
|
|
|
import (
|
|
"sync/atomic"
|
|
|
|
"github.com/diamondburned/arikawa/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))
|
|
}
|