casing

package
v2.934.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySymbolCasing

func ApplySymbolCasing(s string, overrides []string) string

ApplySymbolCasing rewrites PascalCase word segments to the exact casing configured by the caller. It intentionally only replaces complete Pascal segments, so "ApiKey" becomes "APIKey" while "Apiary" is left unchanged.

func CustomCasingOverrides

func CustomCasingOverrides(raw any) []string

Types

type Casing

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

Casing provides a set of methods for converting strings to different casing styles. It generally tries to retain the original casing of acronyms in the input string, unless otherwise specified.

func New

func New() *Casing

func NewWithSymbolCasingOverrides

func NewWithSymbolCasingOverrides(overrides []string) *Casing

func (*Casing) ToCamel

func (c *Casing) ToCamel(s string) string

ToCamel converts a string to camelCase

func (*Casing) ToGoCamel

func (c *Casing) ToGoCamel(s string) string

ToGoCamel converts a string to camelCase using Go initialisms

func (*Casing) ToGoPascal

func (c *Casing) ToGoPascal(s string) string

ToGoPascal converts a string to PascalCase using Go initialisms

func (*Casing) ToGoPascalIgnoreAcronyms

func (c *Casing) ToGoPascalIgnoreAcronyms(s string) string

ToGoPascalIgnoreAcronyms converts a string to PascalCase using Go initialisms but ignoring acronyms in the original string

func (*Casing) ToKEBAB

func (c *Casing) ToKEBAB(s string) string

ToKEBAB converts a string to upper KEBAB-CASE

func (*Casing) ToKebab

func (c *Casing) ToKebab(s string) string

ToKebab converts a string to lower kebab-case

func (*Casing) ToPascal

func (c *Casing) ToPascal(s string) string

ToPascal converts a string to PascalCase

func (*Casing) ToSNAKE

func (c *Casing) ToSNAKE(s string) string

ToSNAKE converts a string to upper SNAKE_CASE

func (*Casing) ToSnake

func (c *Casing) ToSnake(s string) string

ToSnake converts a string to lower snake_case

Jump to

Keyboard shortcuts

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