Skip to content

ergonomics: Set* methods for Optional fields should accept the underlying type instead of Opt #1648

@jaqx0r

Description

@jaqx0r

Description

It is a weird ergonomic to have an optional field and be required to construct the OptX to pass to SetX, instead of the generated API doing this itself.

The semantics of Set imply that the field becomes no longer unknown, but has a value.

E.g.

optx := OptString{Value: "string", Set: true}
s.SetX(optx)

versus

s.SetX("string")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions