mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-01 04:24:19 +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
19 lines
234 B
Go
19 lines
234 B
Go
package moreatomic
|
|
|
|
import "sync/atomic"
|
|
|
|
type String struct {
|
|
v atomic.Value
|
|
}
|
|
|
|
func (s *String) Get() string {
|
|
if v, ok := s.v.Load().(string); ok {
|
|
return v
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (s *String) Set(str string) {
|
|
s.v.Store(str)
|
|
}
|