Documentation
¶
Index ¶
- func AddURLSchema(url string, scheme string) string
- func BytesToString(b []byte) string
- func Camel2Case(name string) string
- func Case2Camel(name string) string
- func Compress(str string) string
- func Dedup(s []string) []string
- func EncodePEM(certPEM []byte) (string, error)
- func Format(str string, data map[string]any) string
- func GenRankStr(n int) string
- func GenRankStrLowercase(n int) string
- func Has(list []string, element string) bool
- func Lcfirst(str string) string
- func Pointer(input string) *string
- func StringToBytes(s string) []byte
- func ToMap(data []string) map[string]struct{}
- func TrimField(ptr any)
- func URLJoin(base string, paths ...string) string
- func Ucfirst(str string) string
- func UnicodeToZH(raw string) (string, error)
- func ZHToUnicode(raw string) string
- type Buffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddURLSchema ¶
AddURLSchema if url do not have scheme then add one sheme should have ://
func Format ¶ added in v0.7.6
Format ... usage: res := Format("this is a {{.name}}, {{.age}} years old", map[string]any{"name": "Bob", "age": 10})
func GenRankStr ¶
GenRankStr gen random string 生成随机字符串 param n: string length 字符串长度
func GenRankStrLowercase ¶
GenRankStrLowercase gen random string with lowercase param n: string length
func TrimField ¶ added in v0.6.1
func TrimField(ptr any)
TrimField trim struct string field, ptr must be a struct pointer
func UnicodeToZH ¶ added in v0.5.4
UnicodeToZH turn unitcode into Chinese
func ZHToUnicode ¶ added in v0.5.4
ZHToUnicode turn Chinese into unicode
Types ¶
Click to show internal directories.
Click to hide internal directories.