ident

package
v0.0.0-...-dc64ae7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ident provides support for converting identifiers between different naming conventions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInitialism

func AddInitialism(ident string)

AddInitialism adds the given identifier to the set of initialisms. The given identifier should be in the PascalCase form and have at most one lower-cased letter which must be at the very end.

Types

type Parts

type Parts [][]byte

Parts represents the normalized elements of an identifier.

func FromCamel

func FromCamel(ident string) Parts

FromCamel parses the given camelCased identifier into its parts.

func FromKebab

func FromKebab(ident string) Parts

FromKebab parses the given kebab-cased identifier into its parts.

func FromPascal

func FromPascal(ident string) (Parts, error)

FromPascal parses the given PascalCased identifier into its parts.

func FromScreamingSnake

func FromScreamingSnake(ident string) Parts

FromScreamingSnake parses the given SCREAMING_SNAKE_CASED identifier into its parts.

func FromSnake

func FromSnake(ident string) Parts

FromSnake parses the given snake_cased identifier into its parts.

func (Parts) String

func (p Parts) String() string

func (Parts) ToCamel

func (p Parts) ToCamel() string

ToCamel converts the identifier into a camelCased string.

func (Parts) ToKebab

func (p Parts) ToKebab() string

ToKebab converts the identifier into a kebab-cased string.

func (Parts) ToPascal

func (p Parts) ToPascal() string

ToPascal converts the identifier into a PascalCased string.

func (Parts) ToScreamingSnake

func (p Parts) ToScreamingSnake() string

ToScreamingSnake converts the identifier into a SCREAMING_SNAKE_CASED string.

func (Parts) ToSnake

func (p Parts) ToSnake() string

ToSnake converts the identifier into a snake_cased string.

Jump to

Keyboard shortcuts

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