# Functions
Add returns a + b.
Ago returns a time string reporting distance from the current date of form 5 hours ago.
Append all args to an array, and return that array.
Array takes a set of interface pointers as variadic args, and returns a single array.
Blank returns true if a string is empty.
CentsToBase converts cents to the base currency unit, preserving cent display, with no currency.
CentsToPrice converts a price in pence to a human friendly price including currency unit At present it assumes the currency is pounds, it should instead take an optional param for currency or not include it at all.
CentsToPriceShort converts a price in pence to a human friendly price abreviated (no pence).
CommaSeparatedArray returns the values as a comma separated string.
Contains returns true if this array of ints contains the given int.
CreateMap - given a set of interface pointers as variadic args, generate and return a map to the values This is currently unused as we just use simpler Map add above to add to context.
CSRF generates an input field tag containing a CSRF token.
CSV escape (replace , with ,,).
Date returns a formatted date string given a time and optional format Date format layouts are for the date 2006-01-02.
DateField sets up a date field with a data-date attribute storing the real date.
Empty returns an empty map[string]interface{} for use as a context.
Escape escapes HTML using HTMLEscapeString.
EscapeURL escapes URLs using HTMLEscapeString.
Exists returns true if this string has a length greater than 0.
Field accepts name string, value interface{}, fieldType string, args ...string.
HTML returns a string (which must not contain user input) as go template HTML.
HTMLAttribute returns a string (which must not contain user input) as go template HTMLAttr.
Int64 returns an int64 from an int.
JSON escapes a string for use in a json template (html template).
JSONTime returns a formatted date string with format suitable for using in a json file.
Link returns got.HTML with an anchor link given text and URL required Attributes (if supplied) should not contain user input.
Map sets a map key and return the map.
Mod returns a modulo b.
NewOption returns a new option, given an id and name.
NumberOptions creates an array of selectables, with an optional min and max value supplied as arguments.
NumberToCommas formats large numbers with commas the entire number is still represented.
NumberToHuman formats large numbers for human consumption some preceision is lost, e.g.
Odd returns true if a is odd.
OptionsForSelect creates a select field given an array of keys and values in order.
PriceToCents converts a price string in human friendly notation (£45 or £34.40) to a price in pence as an int64.
PriceToCentsString returns a price in cents as a string for use in params.
Sanitize the html, leaving only tags we consider safe (see the sanitize package for details and tests).
Script inserts a script tag.
Select creates a select field given an array of keys and values in order.
SelectArray creates a select field given an array of keys and values in order.
Set a map key and return an empty string.
SetIf sets a map key if the given condition is true.
StringOptions creates an array of selectables from strings.
Strip all html tags and returns as go template HTML.
Style inserts a css tag.
Subtract returns a - b.
TextArea returns a field div containing a textarea.
Time returns a formatted time string given a time and optional format.
Truncate text to a given length.
URL returns returns a string (which must not contain user input) as go template URL.
UTCDate returns a formatted date string in 2006-01-02.
UTCNow returns a formatted date string in 2006-01-02.
UTCTime returns a formatted date string in 2006-01-02.
XMLPreamble returns an XML preamble as got.HTML, primarily to work around a bug in html/template which escapes <? see https://github.com/golang/go/issues/12496.
YearNow returns a formatted date string for the current year.
# Structs
Option type contains number and string.
SelectableOption provides a concrete implementation of Selectable - this should be called string option or similar.
# Interfaces
Selectable provides an interface for options in a select.