Skip to content
This repository was archived by the owner on Aug 12, 2022. It is now read-only.
This repository was archived by the owner on Aug 12, 2022. It is now read-only.

Implement a unified type assertion errors handler #25

@amanenk

Description

@amanenk

There are a lot of type assertions that require checks and every time developer needs to build an error by hand.
An integrated solution would ease the process of development.
First construction that comes to mind:

r, ok := resource.Item.(types.Type)
if !ok {
return fmt.Errorf("wrong type assertion: got %s instead of %s", 
  reflect.TypeOf(r).Name(),
  reflect.TypeOf(types.Type{}).Name())
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions