Skip to content

Commit

Permalink
Support nil fields for pointers to primitives (#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 #753
  • Loading branch information
jbizzle authored and abhinav committed Nov 13, 2019
1 parent a6015e1 commit 5637143
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 10 deletions.

0 comments on commit 5637143

Please sign in to comment.