Skip to content

Track pointer initialization for zero values#73

Merged
sethvargo merged 1 commit intomainfrom
sethvargo/ptrs
Aug 5, 2022
Merged

Track pointer initialization for zero values#73
sethvargo merged 1 commit intomainfrom
sethvargo/ptrs

Conversation

@sethvargo
Copy link
Owner

This fixes a bug where a pointer was initialized, but to the zero value. Like a *bool initialized to &false. Previously this would be considered "unset" because false is the zero value for a boolean. Now envconfig considers whether the pointer was initialized first, before checking whether the value is zero.

@sethvargo
Copy link
Owner Author

Fixes #71

/cc @capri-xiyue

This fixes a bug where a pointer was initialized, but to the zero value. Like a *bool initialized to &false. Previously this would be considered "unset" because false is the zero value for a boolean. Now envconfig considers whether the pointer was initialized first, before checking whether the value is zero.
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.

1 participant