treasurer/pkg/echotools/bind.go
2023-06-19 17:29:15 +00:00

14 lines
205 B
Go

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
}