Documentation ¶
Index ¶
- Constants
- func CalculateNearestString(candidates []string, target string) string
- func Contains[T comparable](slice []T, target T) bool
- func FileExists(path string) bool
- func GenerateKey() string
- func GenerateNanoID() string
- func GetHumanReadableSize(v any) string
- func GetSize(v any) int
- func IsDirectory(path string) bool
- func Ptr[T any](v T) *T
- func SizeToStorageUnits[T int64 | int | float64](n T) string
- func ToCamelCase(s string) string
- func ToPascalCase(s string) string
Constants ¶
View Source
const ( MB = 1 << 20 GB = 1 << 30 KB = 1 << 10 )
Variables ¶
This section is empty.
Functions ¶
func CalculateNearestString ¶ added in v3.2.3
Using the levenshtein distance algorithm. It returns the best candidate between the options to match with the target.
If returns an empty result in case the nearest distance is greater than 3.
func Contains ¶
func Contains[T comparable](slice []T, target T) bool
Asks for the hour to the host and returns true in case of consider this a lucky day.
func GenerateKey ¶
func GenerateKey() string
Generates a new key by removing the '-' from a new uuid.
func GetHumanReadableSize ¶
Returns an human-readable representation of the size of the passed JSON value.
func ToCamelCase ¶
func ToPascalCase ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.