Skip to content

NewHandler should return input if it is of type Handler #270

Open
@rittneje

Description

@rittneje

Is your feature request related to a problem? Please describe.
Just had an issue where we accidentally did something like this:

h := lambda.NewHandler(...)
lambda.Start(h)

instead of this:

h := lambda.NewHandler(...)
lambda.StartHandler(h)

This is caused by the fact that Start takes interface{}, so the compiler is unable to detect the error.

Describe the solution you'd like
NewHandler should check if the input implements Handler and if so return the input unchanged, possibly logging some kind of warning.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions