Documentation ¶
Index ¶
- func BytesToString(b []byte) string
- func CsvToInt32s(s string) []int32
- func CsvToInt64s(s string) []int64
- func CsvToInts(s string) []int
- func Int32sToCsv(int32s []int32) string
- func Int64sToCsv(int64s []int64) string
- func StringToBytes(s string) []byte
- func ToBytes(value any) ([]byte, error)
- func ToCamelCase(s string) string
- func ToInt32s(strSlice []string) []int32
- func ToInt64s(strSlice []string) []int64
- func ToInts(strSlice []string) []int
- func ToSlice(data any) []any
- func ToSnakeCase(s string) string
- func ToString(value any) (string, error)
- type Utils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to text without a memory allocation.
func CsvToInt32s ¶
CsvToInt32s 将逗号分隔的string尝试转换成[1,2,3...]的int32 slice Csv means Comma Separated Value
func CsvToInt64s ¶
CsvToInt64s 将逗号分隔的string尝试转换成[1,2,3...]的int64 slice Csv means Comma Separated Value
func Int32sToCsv ¶
Int32sToCsv 将int32 slice转换成用逗号分隔的字符串: 1,2,3
func Int64sToCsv ¶
Int64sToCsv 将int64 slice转换成用逗号分隔的字符串: 1,2,3
func StringToBytes ¶
StringToBytes converts text to byte slice without a memory allocation.
func ToCamelCase ¶
ToCamelCase converts from underscore separated form to camel case form.
func ToSnakeCase ¶
ToSnakeCase converts from camel case form to underscore separated form.
Types ¶
type Utils ¶
type Utils interface { StringToBytes(s string) []byte BytesToString(b []byte) string ToString(value any) (string, error) ToBytes(value any) ([]byte, error) CsvToInt64s(strValue string) []int64 CsvToInt32s(strValue string) []int32 CsvToInts(strValue string) []int Int64sToCsv(int64s []int64) string Int32sToCsv(int32s []int32) string ToInt64s(strSlice []string) []int64 ToInt32s(strSlice []string) []int32 ToInts(strSlice []string) []int ToCamelCase(str string) string ToSnakeCase(s string) string ToSlice(data any) []any }
Click to show internal directories.
Click to hide internal directories.