Skip to content

nil-safety in bart datastructure methods #365

@amalscale

Description

@amalscale

Hi, thank you for your work on this library. I noticed that bart datastructures such as Lite are a little inconsistent in how they treat nil receivers. It is safe to call some methods on nil receivers (e.g. MarshalJSON) but not others (e.g. Equal): https://go.dev/play/p/oldd3wkVGR6. This can cause some surprises when doing lazy initialization of a bart.Lite structure, for example.

My personal preference would be to make all methods nil-safe, but I'm open to learning more about why things are the way they are today. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions