Documentation
¶
Index ¶
- func AppendAll(strs ...interface{}) []string
- func JoinAsString[E Joinables](elements []E, sep string) string
- func MapKeys[K comparable, V any](m map[K]V) []K
- func PtrInt[T constraints.Integer](i T) *T
- func PtrStr(s string) *string
- func StrWhitespacesCleanup(s string) string
- func StringSliceToFlatBytes(lines []string) []byte
- func StrsWhitespacesCleanup(strs []string) []string
- func ToStringers[T any](elems []T) ([]fmt.Stringer, error)
- func Whitespace(n uint) string
- type Joinables
- type NonFileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAll ¶
func AppendAll(strs ...interface{}) []string
AppendAll appends strings and slice of strings together into slice of strings
func JoinAsString ¶
JoinAsString joins the Joinables type elements together with string seperator to return string value. Currently, it only has logic for fmt.Stringer alone.
func MapKeys ¶
func MapKeys[K comparable, V any](m map[K]V) []K
MapKeys returns slice of keys from map of any type
func PtrInt ¶
func PtrInt[T constraints.Integer](i T) *T
PtrInt returns the reference to integer of any type
func StrWhitespacesCleanup ¶
StrWhitespacesCleanup replaces multiple whitespaces/tab/newlines with single whitespace.
func StringSliceToFlatBytes ¶
StringSliceToFlatBytes joins string slice together with line feed (LF) character, making it []byte data. LF character in unix systems = 0xa
func StrsWhitespacesCleanup ¶
StrsWhitespacesCleanup replaces multiple whitespaces/tab/newlines with single whitespace in all strings are slice
func ToStringers ¶
ToStringers wraps elements of input slice with stringer type, provided, all the elements on input slice should implement fmt.Stringer.
Types ¶
type Joinables ¶
Joinables holds the types which are required to be joined together as string. Currently, it only has fmt.Stringer as required in project.
type NonFileWriter ¶
NonFileWriter is a wrapper over IO writer. This is for registering the interface for mocking.