Skip to content

E0709: A method handler doesn't fit ​

A page type's Post, Put, Patch and Delete methods answer those methods on its path, and so do an endpoint type's, Get included. Each takes context.Context first, then what any handler takes — a body struct, *http.Request, … — and returns an error, a ui.Node and an error, or a web.Redirect and an error. A method named Get on a page is refused (the page is the GET), and so is one whose parameters or results can't be bound. Reported at the method.

Wrong ​

go
func (p *Edit) Get(ctx context.Context) error { … }

func (p *Edit) Post(name string, city string) bool { … }
go
type EmployerForm struct {
	Name string `form:"name" validate:"required"`
	City string `form:"city" validate:"required"`
}

func (p *Edit) Post(ctx context.Context, form EmployerForm) (web.Redirect, error) { … }

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.