NewHandler should return input if it is of type Handler
- Dominant language
- Go
- Stars
- 3.8k
- Forks
- 578
- Avg merge
- 8h 18m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
Just had an issue where we accidentally did something like this:
```go
h := lambda.NewHandler(...)
lambda.Start(h)
```
instead of this:
```go
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.
Contributor guide
Assessment
This issue has not been assessed yet.