Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
/ gonocular Public archive

Extremely lightweight wrapper for go's html/template package with dev-time friendly error messages

License

Notifications You must be signed in to change notification settings

CoreyKaylor/gonocular

Repository files navigation

gonocular

Build Status Coverage Status GoDoc

Gonocular

Extremely lightweight wrapper for go's html/template package with dev-time friendly error messages (originally inspired by revel's template support). If gonocular.ProductionMode() is called the package falls back to the standard behavior of causing a panic if the template cannot be parsed with no friendly error messages.

Example Usage

package home

import (
	"github.com/CoreyKaylor/gonocular"
	"net/http"
)

var (
	homeTemplate = gonocular.TemplateFiles("../templates/layout.html", "index.html").Template()
)

func Index(rw http.ResponseWriter, r *http.Request) {
	homeTemplate.RenderHTML(rw, nil)
}

About

Extremely lightweight wrapper for go's html/template package with dev-time friendly error messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages