tmplutil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommentsColumnLimit = 80 - 3 // account for prefix "// "
	CommentsTabWidth    = 4
)

Variables

View Source
var Funcs = template.FuncMap{
	"Comment":     Comment,
	"FirstLetter": FirstLetter,
}

Funcs contains the exported tmplutil functions.

Functions

func Comment

func Comment(cmt string, indentLvl int) string

Comment renders a comment.

func FirstLetter

func FirstLetter(p string) string

FirstLetter returns the first letter in lower-case.

func Render

func Render(w io.Writer, tmpl string, v interface{})

Render renders the given template string with the given key-value pair.

func String

func String(tmpl string, v interface{}) string

String renders the given template to a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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