templates

package
v0.33.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

func Args(vs ...any) []any

Args is a function used to pass arguments to templates.

func CutSuffix

func CutSuffix(s, suffix string) string

CutSuffix is a function used to remove a suffix to a string.

func DescribeStruct

func DescribeStruct(st any) string

DescribeStruct will describe a struct in a human readable way using `%+v` format from the standard library.

func HasField

func HasField(v any, name string) bool

HasField will check if a struct has a field with the given name.

func HelpersFunctions

func HelpersFunctions() template.FuncMap

HelpersFunctions returns the functions that can be used as helpers in a golang template.

func MultiLineComment

func MultiLineComment(comment string) string

MultiLineComment will prefix each line of a comment with "// " in order to make it a valid multiline golang comment.

func Namify

func Namify(sentence string) string

Namify will convert a sentence to a golang conventional type name.

func NamifyWithoutParams

func NamifyWithoutParams(sentence string) string

NamifyWithoutParams will convert a sentence to a golang conventional type name. and will remove all parameters that can appear between '{' and '}'.

func SnakeCase

func SnakeCase(sentence string) string

SnakeCase will convert a sentence to snake case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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