Skip to content

Commit

Permalink
feat:no need to store nil (#1116)
Browse files Browse the repository at this point in the history
* feat:no  need  to  store nil

* lint
  • Loading branch information
tylitianrui committed Oct 6, 2021
1 parent ad6d128 commit f307299
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions userdata.go
Expand Up @@ -21,6 +21,9 @@ func (d *userData) Set(key string, value interface{}) {
return
}
}
if value == nil {
return
}

c := cap(args)
if c > n {
Expand Down

2 comments on commit f307299

@peczenyj
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, how can we remove a user data - instead setting nil ?

@erikdubbelboer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no API for that. A pull request would be welcome!

Please sign in to comment.