Skip to content

Instantly share code, notes, and snippets.

@ykyuen
Created November 19, 2018 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ykyuen/42c06aedff402652586b64b984316202 to your computer and use it in GitHub Desktop.
Save ykyuen/42c06aedff402652586b64b984316202 to your computer and use it in GitHub Desktop.
setup-nested-html-template-in-go-echo-web-framework-12
package handler
import (
"net/http"
"github.com/labstack/echo"
)
func AboutHandler(c echo.Context) error {
// Please note the the second parameter "about.html" is the template name and should
// be equal to one of the keys in the TemplateRegistry array defined in main.go
return c.Render(http.StatusOK, "about.html", map[string]interface{}{
"name": "About",
"msg": "All about Boatswain!",
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment