Skip to content

Conversation

@Abirdcfly
Copy link
Contributor

No description provided.

}

return false
return s.IsPrecreate != nil && *s.IsPrecreate
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is great - much clearer. Thanks for letting us know about the pointer package!

This line is much cleaner than the old function. No need to update the PR, but I wonder if using the BoolDeref() here would make the intent even clearer. E.g.:

return pointer.BoolDeref(s.IsPrecreate, false)

It would be really good to establish a common pattern for comparisons with maybe-null boolean attributes, and carry this forward.

Copy link
Contributor

@jkneubuh jkneubuh left a comment

Choose a reason for hiding this comment

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

@Abirdcfly thanks for the nice clean-up. Very clear with the new code. 👍

@jkneubuh jkneubuh merged commit 1cc98ad into hyperledger-labs:main Nov 4, 2022
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