funcmaps

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package funcmaps exposes utilities to work with template.FuncMap.

* funcmap merging, with guards against unwary overrides (coalesce, protecting builtins) * a default funcmap for golang codegen, with common mangling for go identifiers, go comments handling etc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce

func Coalesce(target template.FuncMap, coalesced ...template.FuncMap) template.FuncMap

Coalesce template.FuncMap s into the target template.FuncMap.

Coalesce is a merge with first wins, never overwriting keys.

Built-in template functions are implied and are therefore always protected from an override.

func Merge

func Merge(target template.FuncMap, merged ...template.FuncMap) template.FuncMap

Merge template.FuncMap s into the target template.FuncMap.

Merge is performed with last wins, overwriting keys.

Built-in template functions are always protected from an override.

func Pick

func Pick(source template.FuncMap, picked ...string) template.FuncMap

Pick cherrypicks a list of functions from a template.FuncMap and yields a clone with only the selected ones. Non-existent symbols are silently ignored.

Types

This section is empty.

Directories

Path Synopsis
Package golang provides the Go-specific template function map used by code generators.
Package golang provides the Go-specific template function map used by code generators.

Jump to

Keyboard shortcuts

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