Swiss army knife for Golang developers
- Async tasks
- Async tasks with results
- Command exec utils
- Zero alloc string-byte conversion
- Time utils
- Array utils
Async
New().Task(
func () {
a = 1
fmt.Println("1")
}, func () {
b = 1
fmt.Println("2")
}).Await()
results := NewAsyncWorkWithResult[int]().TaskWithResult(
func() int {
return 5
}, func() int {
return 11
}).AwaitResult()
Command exec
out := Exec("echo", "test")
strReader := strings.NewReader("hello world")
outWriter := bytes.NewBuffer(nil)
errWriter := bytes.NewBuffer(nil)
ExecPipe(strReader, outWriter, errWriter, "echo", "test")
outputStr := outWriter.String()
Zero alloc string byte conversion
str := String([]byte("test"))
byteArr := Byte("test")