snaker

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 4 Imported by: 89

Documentation

Overview

Package snaker provides methods to convert CamelCase to and from snake_case.

snaker takes into takes into consideration common initialisms (ie, ID, HTTP, ACL, etc) when converting to/from CamelCase and snake_case.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInitialisms

func AddInitialisms(initialisms ...string) error

AddInitialisms adds initialisms to the recognized initialisms.

func CamelToSnake

func CamelToSnake(name string) string

CamelToSnake converts name from camel case ("AnIdentifier") to snake case ("an_identifier").

func CamelToSnakeIdentifier

func CamelToSnakeIdentifier(name string) string

CamelToSnakeIdentifier converts name from camel case to a snake case identifier.

func ForceCamelIdentifier

func ForceCamelIdentifier(name string) string

ForceCamelIdentifier forces name to its CamelCase specific to Go ("AnIdentifier").

func ForceLowerCamelIdentifier

func ForceLowerCamelIdentifier(name string) string

ForceLowerCamelIdentifier forces the first portion of an identifier to be lower case ("anIdentifier").

func IsInitialism

func IsInitialism(initialism string) bool

IsInitialism indicates whether or not an initialism is registered as an identified initialism.

func SnakeToCamel

func SnakeToCamel(name string) string

SnakeToCamel converts name to CamelCase.

func SnakeToCamelIdentifier

func SnakeToCamelIdentifier(name string) string

SnakeToCamelIdentifier converts name to its CamelCase identifier (first letter is capitalized).

Types

This section is empty.

Jump to

Keyboard shortcuts

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