Skip to content

apis.Convertible has confusing function names #1057

@dprotaso

Description

@dprotaso

What ConvertUp & ConvertDown should do isn't immediately obvious.

pkg/apis/interfaces.go

Lines 37 to 45 in 79f1045

// Convertible indicates that a particular type supports conversions to/from
// "higher" versions of the same type.
type Convertible interface {
// ConvertUp up-converts the receiver into `to`.
ConvertUp(ctx context.Context, to Convertible) error
// ConvertDown down-converts from `from` into the receiver.
ConvertDown(ctx context.Context, from Convertible) error
}

Suggested Alternative

  • ConvertTo & ConvertFrom

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIkind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions