naming

package
v0.0.0-...-20536d3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageName

func PackageName(moduleName string) string

PackageName returns a valid Go package name from a module path.

"github.com/myorg/toko-online" → "tokoonline"
"pasaremas"                    → "pasaremas"

func ToKebabCase

func ToKebabCase(s string) string

ToKebabCase converts snake_case to kebab-case.

"bank_account" → "bank-account"

func ToPascalCase

func ToPascalCase(s string) string

ToPascalCase converts snake_case to PascalCase, respecting Go initialisms.

"bank_account" → "BankAccount"
"buyer_id"     → "BuyerID"
"http_url"     → "HTTPURL"

func ToPlural

func ToPlural(s string) string

ToPlural returns a naive plural form suitable for table names.

"user"         → "users"
"policy"       → "policies"
"gateway"      → "gateways"
"bank_account" → "bank_accounts"

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase converts PascalCase to snake_case, handling Go initialisms.

"BankAccount" → "bank_account"
"BuyerID"     → "buyer_id"
"HTTPRequest" → "http_request"

Types

This section is empty.

Jump to

Keyboard shortcuts

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