package module
Version: v0.0.4 Latest Latest

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 4 Imported by: 1


Jet template engine functions

Build Status Coverage Status Go.Dev reference Go Report Card Release Downloads

This library inspired by Masterminds/sprig).

$ go get -u


import (

set := jet.NewHTMLSet("")
// attaches functions to Set.


trim strings.TrimSpace
trimPrefix strings.TrimPrefix
trimSuffix strings.TrimSuffix
join strings.Join
now time.Now
date time.Time.Format




This section is empty.


This section is empty.


func Ago added in v0.0.3

func Ago(args jet.Arguments) reflect.Value

Ago returns duration from time.Now in seconds resolution.

func Date added in v0.0.3

func Date(args jet.Arguments) reflect.Value

Date formats a date with the given layout.

func DateInZone added in v0.0.4

func DateInZone(args jet.Arguments) reflect.Value

DateInZone returns the copy of same time instant with the given time zone.

func Join

func Join(args jet.Arguments) reflect.Value

Join concatenates the elements of its first argument to create a single string.

func Now

func Now(jet.Arguments) reflect.Value

Now returns the current local time.

func Title

func Title(args jet.Arguments) reflect.Value

Title converts a string to title case.

func Trim

func Trim(args jet.Arguments) reflect.Value

Trim removes space from either side of a string.

func TrimPrefix added in v0.0.4

func TrimPrefix(args jet.Arguments) reflect.Value

TrimPrefix removes the prefix of a string.

func TrimSuffix

func TrimSuffix(args jet.Arguments) reflect.Value

TrimSuffix removes the suffix of a string.


type FuncMap

type FuncMap map[string]jet.Func

FuncMap is a set of functions.

func GenericFuncMap added in v0.0.3

func GenericFuncMap() FuncMap

GenericFuncMap returns generic functions.

func (FuncMap) AttachTo added in v0.0.3

func (fm FuncMap) AttachTo(set *jet.Set)

AttachTo attaches function to Set.

Jump to

Keyboard shortcuts

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