Skip to content

Commit

Permalink
fix conflicts with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuazhang committed May 8, 2020
2 parents 892a03d + a6ab447 commit 937ab5a
Show file tree
Hide file tree
Showing 147 changed files with 4,950 additions and 5,021 deletions.
6 changes: 6 additions & 0 deletions attributes/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func New(kvs ...interface{}) *Attributes {
// times, the last value overwrites all previous values for that key. To
// remove an existing key, use a nil value.
func (a *Attributes) WithValues(kvs ...interface{}) *Attributes {
if a == nil {
return New(kvs...)
}
if len(kvs)%2 != 0 {
panic(fmt.Sprintf("attributes.New called with unexpected input: len(kvs) = %v", len(kvs)))
}
Expand All @@ -66,5 +69,8 @@ func (a *Attributes) WithValues(kvs ...interface{}) *Attributes {
// Value returns the value associated with these attributes for key, or nil if
// no value is associated with key.
func (a *Attributes) Value(key interface{}) interface{} {
if a == nil {
return nil
}
return a.m[key]
}
Loading

0 comments on commit 937ab5a

Please sign in to comment.