Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for nil marshalable pointers #1

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

joanlopez
Copy link

Currently, if there is any custom type (type ...) that:

  • isn't represented by an underlying struct (e.g. type Custom uint8 or even type Custom2 Custom)
  • implements any of the supported marshaleable interfaces (either encoding.TextUnmarshaler or encoding.BinaryUnmarshaler)
  • and is defined in the config specification passed to envconfig.Process(...) as a (nil) pointer (zero value for pointers)

The processing fails: either panics (depends on the implementation) or just doesn't assign the value to the receiver.

@mstoykov mstoykov merged commit 29baae8 into mstoykov:master Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants