templatex

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(list []string, sep string) string

func LineComment

func LineComment(s string) string

func LowerCamel

func LowerCamel(s string) string

func UpperCamel

func UpperCamel(s string) string

Types

type T

type T struct {
	// contains filtered or unexported fields
}

T is a template helper.

func New

func New() *T

New creates a new template helper.

func (*T) AppendFuncMap

func (t *T) AppendFuncMap(fm template.FuncMap)

func (*T) MustExecute

func (t *T) MustExecute(data interface{}) *T

MustExecute executes the template.

func (*T) MustParse

func (t *T) MustParse(text string) *T

MustParse parses the template.

func (*T) MustSave

func (t *T) MustSave(filename string, format bool)

MustSave saves the template to the given filename, it will do nothing if it exists.

func (*T) MustSaveAs

func (t *T) MustSaveAs(filename string, formatCode bool)

MustSaveAs saves the template to the given filename, it will overwrite the file if it exists.

func (*T) Write

func (t *T) Write(writer io.Writer, formatCode bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL