Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (24 sloc) 634 Bytes
package templatesystem
import (
type PassThroughTemplate struct {
text string
func (self *PassThroughTemplate) Render(out io.Writer, context interface{}) (err error) {
_, err = out.Write([]byte(self.text))
return err
type PassThrough struct{}
func (self *PassThrough) ParseFile(filename string) (Template, error) {
text, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
return self.ParseString(string(text), filepath.Base(filename))
func (self *PassThrough) ParseString(text, name string) (Template, error) {
return &PassThroughTemplate{text: text}, nil
Jump to Line
Something went wrong with that request. Please try again.