Skip to content

Instantly share code, notes, and snippets.

View marvinhosea's full-sized avatar
🎯
Pin point

Marvin Collins Hosea marvinhosea

🎯
Pin point
View GitHub Profile
@marvinhosea
marvinhosea / Contexpareet.go
Created February 20, 2023 10:35
Contexpareet.go
package main
import (
"context"
"errors"
"log"
)
func main() {
parentCtx, parentCancelWithCause := context.WithCancelCause(context.Background())
@marvinhosea
marvinhosea / Child context.go
Last active February 20, 2023 20:19
Child context.go
package main
import (
"context"
"errors"
"log"
)
func main() {
parentCtx, parentCancelWithCause := context.WithCancelCause(context.Background())
@marvinhosea
marvinhosea / Example.go
Created February 20, 2023 15:09
Example
package main
import (
"errors"
"fmt"
"log"
)
var (
errOne = errors.New("error one")