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

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

@rbehjati

Description

@rbehjati

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions