Documentation
¶
Index ¶
- func DisplayURL(urlStr string) string
- func DisplayWidth(s string) int
- func FormatSlice(values []string, lineLength uint, indent uint, prependWith string, ...) string
- func FuzzyAgo(a, b time.Time) string
- func FuzzyAgoAbbr(a, b time.Time) string
- func Indent(s, indent string) string
- func PadRight(maxWidth int, s string) string
- func Pluralize(num int, thing string) string
- func RemoveDiacritics(value string) string
- func RemoveExcessiveWhitespace(s string) string
- func Title(s string) string
- func Truncate(maxWidth int, s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayURL ¶
DisplayURL returns a copy of the string urlStr removing everything except the scheme, hostname, and path. If the scheme is not specified, "https" is assumed. If there is an error parsing urlStr then urlStr is returned without modification.
func DisplayWidth ¶
func FormatSlice ¶
func FormatSlice(values []string, lineLength uint, indent uint, prependWith string, appendWith string, sort bool) string
FormatSlice concatenates elements of the given string slice into a well-formatted, possibly multiline, string with specific line length limit. Elements can be optionally surrounded by custom strings (e.g., quotes or brackets). If the lineLength argument is non-positive, no line length limit will be applied.
func FuzzyAgoAbbr ¶
FuzzyAgoAbbr is an abbreviated version of FuzzyAgo. It returns a human readable string of the time duration between a and b that is estimated to the nearest unit of time.
func RemoveDiacritics ¶
RemoveDiacritics returns the input value without "diacritics", or accent marks
func RemoveExcessiveWhitespace ¶
RemoveExcessiveWhitespace returns a copy of the string s with excessive whitespace removed.
Types ¶
This section is empty.