casing

package
v0.0.0-...-c369810 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caser

type Caser struct {
	// contains filtered or unexported fields
}

Caser converts strings from camel_case to UpperCamelCase.

func NewCaser

func NewCaser() Caser

func (Caser) AddAcronym

func (cs Caser) AddAcronym(str, acronym string)

AddAcronym adds an acronym that's specially handled in conversion routines.

func (Caser) AddAcronyms

func (cs Caser) AddAcronyms(acros map[string]string)

AddAcronyms adds each acronym that's specially handled in conversion routines.

func (Caser) ToLowerGoIdent

func (cs Caser) ToLowerGoIdent(s string) string

ToLowerGoIdent converts a string into a legal, uncapitalized Go identifier, respecting registered acronyms. Returns the empty string if no conversion is possible.

func (Caser) ToUpperGoIdent

func (cs Caser) ToUpperGoIdent(s string) string

ToUpperGoIdent converts a string into a legal, capitalized Go identifier, respecting registered acronyms. Returns the empty string if no conversion is possible.

Jump to

Keyboard shortcuts

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