Skip to content

Instantly share code, notes, and snippets.

View MetalBlueberry's full-sized avatar

Victor MetalBlueberry

View GitHub Profile
@MetalBlueberry
MetalBlueberry / failfast.go
Created December 10, 2019 13:53
Go Fail Fast Wait Group
package failfast
import (
"context"
"sync"
)
// FailFastWG allow synchronization between multiple parallel goroutines.
// If one fails, the common context is cancelled and the others should return.
type WaitGroup struct {
@MetalBlueberry
MetalBlueberry / main_test.go
Last active October 14, 2020 18:27
Golang assert two XML are equal
package main_test
import (
"encoding/xml"
"io"
"testing"
"github.com/stretchr/testify/assert"
)