Created
September 7, 2023 13:01
-
-
Save mattn/dea817dd2e587ed70c61fa4f4573d015 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Users/is/dev-env/go/project1 | |
go 1.21.0 | |
require golang.org/x/sync v0.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"time" | |
"golang.org/x/sync/errgroup" | |
) | |
func main() { | |
eg := new(errgroup.Group) | |
eg.Go(func() error { | |
time.Sleep(1 * time.Second) | |
return errors.New("error") | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment