From a85b15eff9f2092b1cf20d4fb804899dd0d5e422 Mon Sep 17 00:00:00 2001 From: Bill Fumerola Date: Tue, 9 May 2017 11:29:30 -0700 Subject: [PATCH] Use our own Value for String --- string.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/string.go b/string.go index acf0f5b..ede8136 100644 --- a/string.go +++ b/string.go @@ -20,10 +20,8 @@ package atomic -import "sync/atomic" - -// String is an atomic type-safe wrapper around atomic.Value for strings. -type String struct{ v atomic.Value } +// String is an atomic type-safe wrapper around Value for strings. +type String struct{ v Value } // NewString creates a String. func NewString(str string) *String { @@ -44,7 +42,7 @@ func (s *String) Load() string { } // Store atomically stores the passed string. -// Note: Converting the string to an interface{} to store in the atomic.Value +// Note: Converting the string to an interface{} to store in the Value // requires an allocation. func (s *String) Store(str string) { s.v.Store(str)