Skip to content

Instantly share code, notes, and snippets.

View dimied's full-sized avatar
💭
I may be slow to respond.

dimied

💭
I may be slow to respond.
View GitHub Profile
@dimied
dimied / return_values.go
Created October 9, 2022 11:58 — forked from henrysdev/return_values.go
Another example of how we can capture return values from functions ran with runAsync
import "net/http"
func makeRequest(url string, response *http.Response) GenericFunction {
return func() error {
resp, err := http.Get(url)
if err != nil {
return err
}
response = resp
return nil
@dimied
dimied / run_async_allow_errors.go
Created October 9, 2022 11:55 — forked from henrysdev/run_async_allow_errors.go
Run Async Allow Errors
import (
"bytes"
"debug"
"fmt"
"sync"
)
// Alias for a function that takes no args and returns an error
type GenericFunction func() error