Skip to content

E0406: A handler returns what the app can't write ​

A handler's results become the response: nothing (204), an error, a value (JSON, or HTML for a ui.Node), a value and an error, or a Result[T] (vuka.Result[T] in Go). Other result lists can't be written. Reported at boot, and by vukavet.

Wrong ​

vuka
@web.Get("/pets/{id}")
func ShowPet(id int) (Pet, int, error) { … }
go
func ShowPet(id int) (Pet, int, error) { return Pet{}, 0, nil }

func init() { web.Routes.Get("/pets/{id}", ShowPet) }
vuka
@web.Get("/pets/{id}")
func ShowPet(id int) Result[Pet] { … }
go
func ShowPet(id int) (Pet, error) { return Pet{}, nil }

func init() { web.Routes.Get("/pets/{id}", ShowPet) }

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.