tools

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Into

func Into[T any](
	dst *T,
	data []byte,
	unmarshalers ...func([]byte) (T, error),
) error

func IntoArray

func IntoArray[T any](
	dst *[]T,
	data []byte,
	unmarshalers ...func([]byte) (T, error),
) error

func IsReservedKeyword

func IsReservedKeyword(s string) bool

func IsValidIdent

func IsValidIdent(s string) bool

func OneOf

func OneOf[T any](data []byte, unmarshalers ...func([]byte) (T, error)) (T, error)

func OneOfArray

func OneOfArray[T any](data []byte, unmarshalers ...func([]byte) (T, error)) ([]T, error)

same as one of but returns an array of _Child

func RequireFields

func RequireFields(
	dst json.RawMessage,
	fields ...string,
) error

func RequireOneOfFields

func RequireOneOfFields(
	dst json.RawMessage,
	fields ...string,
) error

func ToCamel

func ToCamel(s string) string

ToCamel converts a string to CamelCase

func ToCamelLower

func ToCamelLower(s string) string

func ToCamelUpper

func ToCamelUpper(s string) string

func ToCamelWithAcronyms

func ToCamelWithAcronyms(
	s string,
	acronyms map[string]bool,
) string

ToCamel converts a string to CamelCase

func ToDelimited

func ToDelimited(s string, delimiter uint8) string

ToDelimited converts a string to delimited.snake.case (in this case `delimiter = '.'`)

func ToKebab

func ToKebab(s string) string

ToKebab converts a string to kebab-case

func ToLowerCamel

func ToLowerCamel(s string) string

ToLowerCamel converts a string to lowerCamelCase

func ToLowerCamelWithAcronyms

func ToLowerCamelWithAcronyms(
	s string,
	acronyms map[string]bool,
) string

ToLowerCamel converts a string to lowerCamelCase

func ToScreamingDelimited

func ToScreamingDelimited(s string, delimiter uint8, ignore uint8, screaming bool) string

ToScreamingDelimited converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `delimiter = '.'; screaming = true`) or delimited.snake.case (in this case `delimiter = '.'; screaming = false`)

func ToScreamingKebab

func ToScreamingKebab(s string) string

ToScreamingKebab converts a string to SCREAMING-KEBAB-CASE

func ToScreamingSnake

func ToScreamingSnake(s string) string

ToScreamingSnake converts a string to SCREAMING_SNAKE_CASE

func ToSnake

func ToSnake(s string) string

ToSnake converts a string to snake_case

func ToSnakeWithIgnore

func ToSnakeWithIgnore(s string, ignore uint8) string

func TryUnmarshal

func TryUnmarshal[T any](data []byte) (T, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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