[VOL-4291] Rw-core updates for gRPC migration
Change-Id: I8d5a554409115b29318089671ca4e1ab3fa98810
diff --git a/vendor/go.uber.org/atomic/string.go b/vendor/go.uber.org/atomic/string.go
index ede8136..225b7a2 100644
--- a/vendor/go.uber.org/atomic/string.go
+++ b/vendor/go.uber.org/atomic/string.go
@@ -1,4 +1,6 @@
-// Copyright (c) 2016 Uber Technologies, Inc.
+// @generated Code generated by gen-atomicwrapper.
+
+// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -20,30 +22,33 @@
package atomic
-// String is an atomic type-safe wrapper around Value for strings.
-type String struct{ v Value }
+// String is an atomic type-safe wrapper for string values.
+type String struct {
+ _ nocmp // disallow non-atomic comparison
-// NewString creates a String.
-func NewString(str string) *String {
- s := &String{}
- if str != "" {
- s.Store(str)
+ v Value
+}
+
+var _zeroString string
+
+// NewString creates a new String.
+func NewString(v string) *String {
+ x := &String{}
+ if v != _zeroString {
+ x.Store(v)
}
- return s
+ return x
}
// Load atomically loads the wrapped string.
-func (s *String) Load() string {
- v := s.v.Load()
- if v == nil {
- return ""
+func (x *String) Load() string {
+ if v := x.v.Load(); v != nil {
+ return v.(string)
}
- return v.(string)
+ return _zeroString
}
// Store atomically stores the passed string.
-// 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)
+func (x *String) Store(v string) {
+ x.v.Store(v)
}