github.com/searKing/golang/go@v1.2.74/container/stream/op/terminal/sharedresult_atomicvalue.go (about) 1 // Code generated by "go-atomicvalue -type sharedResult<Sink>"; DO NOT EDIT. 2 3 package terminal 4 5 import "sync/atomic" 6 7 func _() { 8 // An "cannot convert sharedResult literal (type sharedResult) to type atomic.Value" compiler error signifies that the base type have changed. 9 // Re-run the go-atomicvalue command to generate them again. 10 _ = (atomic.Value)(sharedResult{}) 11 } 12 13 var _nil_sharedResult_Sink_value = func() (val Sink) { return }() 14 15 func (m *sharedResult) Store(value Sink) { 16 (*atomic.Value)(m).Store(value) 17 } 18 19 func (m *sharedResult) Load() Sink { 20 value := (*atomic.Value)(m).Load() 21 if value == nil { 22 return _nil_sharedResult_Sink_value 23 } 24 return value.(Sink) 25 }