Use an internal "Optional" type to represent optional values

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      We currently use two patterns for optional values:

      1. Use pointer values, where nil means not set.
      2. Use a pair of value and bool for each value, where the bool indicates whether the value is set or not.

      Both of those have ergonomic issues and lead to lots of wonky code for handling the "not set" condition. Instead, we could use an optional type internally with an API like Rust's "Option" type.

      See an example here.

      Definition of done

      What must be done to consider the task complete?

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            Unassigned
            Reporter:
            Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: