Skip to content

Commit

Permalink
Support nil fields for pointers to primitives (uber-go#758)
Browse files Browse the repository at this point in the history
This adds support for building fields from pointers to primitive types
we already accept.

These new field constructors accept and handle `nil` values in addition
to the non-nil primitive values.

For nil values, we fall back to the behavior of `zap.Reflect(..)`,
which we optimize for in the JSON encoder so that we don't use
`encoding/json` just to build the string `"null"`.

Resolves uber-go#753
  • Loading branch information
jbizzle authored and abhinav committed Nov 13, 2019
1 parent 80b59bd commit 022c60f
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 10 deletions.
Loading

0 comments on commit 022c60f

Please sign in to comment.