Documentation ¶
Index ¶
- type Namespace
- func (ns *Namespace) Append(slice, i interface{}) ([]interface{}, error)
- func (ns *Namespace) First(slice interface{}) (interface{}, error)
- func (ns *Namespace) Last(slice interface{}) (interface{}, error)
- func (ns *Namespace) Prepend(slice, i interface{}) ([]interface{}, error)
- func (ns *Namespace) Reverse(slice interface{}) ([]interface{}, error)
- func (ns *Namespace) Slice(i ...interface{}) []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace defines the methods for slices to be used as template functions.
func (*Namespace) Append ¶
Append
Adds and element to the end of the slice.
Example: {{ append (slice "hello" "world" "!") "verbis" }} Returns: `[hello world ! verbis]`
func (*Namespace) First ¶
First
Retrieves the first element of the slice.
Example: {{ first (slice "hello" "world" "!") }} Returns: `hello`
func (*Namespace) Last ¶
Last
Retrieves the last element of the slice.
Example: {{ last (slice "hello" "world" "!") }} Returns: `!`
func (*Namespace) Prepend ¶
Prepend
Adds and element to the beginning of the slice.
Example: {{ prepend (slice "hello" "world" "!") "verbis" }} Returns: `[verbis hello world !]`
Click to show internal directories.
Click to hide internal directories.