Documentation
¶
Index ¶
- func CamelCase(s string) string
- func ContainsAnyStr(s string, substrings ...string) bool
- func ContainsAnyStrIgnoreCase(s string, substrings ...string) bool
- func CutPrefixIgnoreCase(s string, prefix string) (string, bool)
- func CutPrefixIgnoreCaseAny(s string, prefix ...string) (string, bool)
- func CutSuffixIgnoreCase(s string, suffix string) (string, bool)
- func CutSuffixIgnoreCaseAny(s string, suffix ...string) (string, bool)
- func EqualAnyStr(s string, canditates ...string) bool
- func FmtFloat(f float64, width int, precision int) string
- func HasAnyPrefix(s string, suf ...string) bool
- func HasAnySuffix(s string, suf ...string) bool
- func HasPrefixIgnoreCase(s string, prefix string) bool
- func HasSuffixIgnoreCase(s string, suffix string) bool
- func IsBlankStr(s string) bool
- func LastNStr(s string, n int) string
- func MatchPath(pattern, s string) bool
- func MatchPathAny(pattern []string, s string) bool
- func MaxLenStr(s string, max int) string
- func NamedSprintf(pat string, p map[string]any) string
- func NamedSprintfv(pat string, v any) string
- func PadNum(n int, digit int) string
- func PadSpace(n int, s string) string
- func PadToken(n int, s string, tok string) string
- func QuoteStr(s string) string
- func RuneWidth(r rune) int
- func SAddLineIndent(s string, indentChar string) string
- func Spaces(count int) string
- func SplitKV(s string, token string) (string, string, bool)
- func SplitStr(s, sep string) []string
- func StrWidth(s string) int
- func Tabs(count int) string
- func ToStr(v any) string
- func TrimStrSlice(s []string)
- func UnquoteStr(s string) string
- type IndWritef
- type IndentWriter
- func (i *IndentWriter) DecrIndent()
- func (i *IndentWriter) IncrIndent()
- func (i *IndentWriter) NoIndWritef(pat string, args ...any) *IndentWriter
- func (i *IndentWriter) NoLbWritef(pat string, args ...any) *IndentWriter
- func (i *IndentWriter) NoLbWritefWhen(condition bool, pat string, args ...any) *IndentWriter
- func (i *IndentWriter) SetIndent(ind int)
- func (i *IndentWriter) StepIn(f func(iw *IndentWriter)) *IndentWriter
- func (i *IndentWriter) Writef(pat string, args ...any) *IndentWriter
- type SLPinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsAnyStr ¶
func CutPrefixIgnoreCase ¶
Cut prefix from s in a case-insensitive way.
func CutPrefixIgnoreCaseAny ¶
Cut any prefix from s in a case-insensitive way.
func CutSuffixIgnoreCase ¶
Cut suffix from s in a case-insensitive way.
func CutSuffixIgnoreCaseAny ¶
Cut any suffix from s in a case-insensitive way.
func EqualAnyStr ¶
func HasAnyPrefix ¶
func HasAnySuffix ¶
func HasPrefixIgnoreCase ¶
Check if s has the prefix in a case-insensitive way.
func HasSuffixIgnoreCase ¶
Check if s has the suffix in a case-insensitive way.
func MatchPathAny ¶
func NamedSprintf ¶
Format message using named args, e.g., '${startTime} ${message}'
func NamedSprintfv ¶
Format message using fields in struct, e.g., '${startTime} ${message}'
Equivalent to following code:
NamedSprintf(pat, ReflectGenMap(myStruct))
func SAddLineIndent ¶
func TrimStrSlice ¶
func TrimStrSlice(s []string)
func UnquoteStr ¶
Types ¶
type IndentWriter ¶
func NewIndentWriter ¶
func NewIndentWriter(indentStr string) IndentWriter
func (*IndentWriter) DecrIndent ¶
func (i *IndentWriter) DecrIndent()
func (*IndentWriter) IncrIndent ¶
func (i *IndentWriter) IncrIndent()
func (*IndentWriter) NoIndWritef ¶
func (i *IndentWriter) NoIndWritef(pat string, args ...any) *IndentWriter
Writef without indentation and with line break.
func (*IndentWriter) NoLbWritef ¶
func (i *IndentWriter) NoLbWritef(pat string, args ...any) *IndentWriter
Writef with indentation and without line break.
func (*IndentWriter) NoLbWritefWhen ¶
func (i *IndentWriter) NoLbWritefWhen(condition bool, pat string, args ...any) *IndentWriter
NoLbWritef(..) when condition is true else Writef(..).
func (*IndentWriter) SetIndent ¶
func (i *IndentWriter) SetIndent(ind int)
func (*IndentWriter) StepIn ¶
func (i *IndentWriter) StepIn(f func(iw *IndentWriter)) *IndentWriter
func (*IndentWriter) Writef ¶
func (i *IndentWriter) Writef(pat string, args ...any) *IndentWriter
Click to show internal directories.
Click to hide internal directories.