Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Improve the use of strings in reference values & ProvenanceIR #234

Open
rbehjati opened this issue Jun 1, 2023 · 0 comments
Open

Improve the use of strings in reference values & ProvenanceIR #234

rbehjati opened this issue Jun 1, 2023 · 0 comments

Comments

@rbehjati
Copy link
Contributor

rbehjati commented Jun 1, 2023

Currently, in the verifier, the endorser, and ProvenanceIR, we assign different meanings to a nil string and an empty ("") string. This is against some best practices:

https://go.dev/doc/effective_go#allocation_new discusses zero values and "make the zero value useful".

go-style/decisions#literal-zero-value-fields asserts the readability of zero-value construction.

A counterargument

A more common pattern is to use a boolean to signal the presence or absence of a value.

Ref: Readability review on cl/536413558

CC @mariaschett

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant