golang

package
v0.0.0-...-655fa59 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

golang default funcmap

List of functions exposed to templates.

Available functions

arrayInitializer
assert
blockcomment
camelize
cleanPath
comment
contains
containsCI
containsPkgStr
dasherize
dict
dropPackage
escapeBackticks
filename
gt0
hasInsecure
hasPrefix
hasSecure
httpStatus
humanize
imports
inspect
isInteger
joinFilePath
joinPath
json
mdBlock
mediaTypeName
pad
padSurround
pascalize
pluralizeFirstWord
prettyjson
snakize
stringContains
toGoName
toPackageName
toPackagePath
trimSpace
varname

This documentation has been generated from source. Please run go generate to update this file.

Documentation

Overview

Package golang proposes a default template.FuncMap suited for golang code generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFuncMap

func DefaultFuncMap(opts ...Option) template.FuncMap

DefaultFuncMap yields a map with default functions for use in the templates.

The available functions are specifically biased toward golang code generation.

These are made available to every template.

Types

type Error

type Error string

Error is a sentinel error type for all errors raised by this package.

const ErrFuncMap Error = "golang funcmap error"

ErrFuncMap is a sentinel error that wraps all errors raised by this package.

const ErrTemplateAssertion Error = "assertion failed in template"

ErrTemplateAssertion is an error reported by the "assert" function in templates.

func (Error) Error

func (e Error) Error() string

type Option

type Option func(o *options)

func WithNameManglerOptions

func WithNameManglerOptions(opts ...mangling.Option) Option

WithNameManglerOptions defines options to tune the mangling.NameMangler used by this template.FuncMap.

Jump to

Keyboard shortcuts

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