transforms

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCase

func ApplyCase(name string, convention NamingConvention) string

ApplyCase converts a string to a specific naming convention (in case you need to override the default)

func ToCamelCase

func ToCamelCase(name string) string

ToCamelCase converts various naming formats to camelCase Examples:

  • snake_case -> snakeCase
  • PascalCase -> pascalCase
  • alreadyCamelCase -> alreadyCamelCase

func ToCase

func ToCase(name string) string

ToCase converts a string to the specified naming convention

func ToSnakeCase

func ToSnakeCase(name string) string

ToSnakeCase converts various naming formats to snake_case Examples:

  • camelCase -> camel_case
  • PascalCase -> pascal_case
  • already_snake_case -> already_snake_case

func TransformStringFunctionStyle

func TransformStringFunctionStyle(name string) string

Types

type NamingConvention

type NamingConvention string

NamingConvention represents different naming conventions

const (
	SnakeCase NamingConvention = "snake_case"
	CamelCase NamingConvention = "camelCase"
)

func GetCurrentConvention

func GetCurrentConvention() NamingConvention

GetCurrentConvention returns the current naming convention

Jump to

Keyboard shortcuts

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