Documentation ¶
Overview ¶
Package xlib is an ever growing collection of useful Go functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parallel ¶
Parallel starts the given functions each in a separate goroutine, and returns a channel where errors from the functions are posted. The channel is closed when all goroutines have completed.
func StrJoinEx ¶
StrJoinEx joins the given arguments using the supplied separators, for example, given the separator list of [": ", ", ", ", and "] and the arguments ["AAA", "BBB", "CCC", "DDD"], the resulting string will be "AAA: BBB, CCC, and DDD".
func WriteFile ¶
WriteFile safely replaces the content of the given file. First, it creates a temporary file, then it calls the supplied function to actually write to the file, and in the end it moves the temporary to the given target file. In case of any error or a panic the temporary file is always removed. The target pathname must either not exist, or refer to an existing regular file, in which case it will be replaced. To avoid copying files across different filesystems the temporary file is created in the same directory as the target.
Types ¶
This section is empty.