いずれのtemplateからも便利なテンプレート関数を提供するSprigを使用できる。

import (
  "github.com/Masterminds/sprig"
  "html/template"
)
 
// This example illustrates that the FuncMap *must* be set before the
// templates themselves are loaded.
tpl := template.Must(
  template.New("base").Funcs(sprig.FuncMap()).ParseGlob("*.html")
)