The Hello World example on the Echo homepage appears to be outdated for Echo v5.
The homepage currently shows:
package main
import "github.com/labstack/echo/v5"
func main() {
e := echo.New()
e.GET("/", func(c *echo.Context) error {
return c.JSON(200, echo.Map{"message": "Hello, World!"})
})
e.Start(":1323")
}
However, echo.Map is not available in Echo v5, so copying this example results in a compilation error.
The Quickstart documentation uses a regular Go map instead:
return c.JSON(http.StatusOK, map[string]string{
"message": "Hello, World!",
})
Expected behavior
The homepage example should compile when copied using the currently advertised Echo v5 dependency.
Suggested fix
Update the homepage example to match the current v5 Quickstart, or at minimum replace:
echo.Map{"message": "Hello, World!"}
with:
map[string]string{"message": "Hello, World!"}
Thanks!
The Hello World example on the Echo homepage appears to be outdated for Echo v5.
The homepage currently shows:
However,
echo.Mapis not available in Echo v5, so copying this example results in a compilation error.The Quickstart documentation uses a regular Go map instead:
Expected behavior
The homepage example should compile when copied using the currently advertised Echo v5 dependency.
Suggested fix
Update the homepage example to match the current v5 Quickstart, or at minimum replace:
with:
Thanks!