treasurer/internal/utils/echotools/bind.go

14 lines
205 B
Go
Raw Normal View History

2023-06-13 13:22:51 +00:00
package echotools
import "github.com/labstack/echo/v4"
func Bind[T any](ctx echo.Context) (*T, error) {
item := new(T)
if err := ctx.Bind(item); err != nil {
return nil, err
}
return item, nil
}