Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commiteb618aa

Browse files
committed
fixup! Add new clog.ErrGroup
1 parent99a751f commiteb618aa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎internal/clog/errgroup.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import (
1212
//
1313
// Take for example, a case in which we are concurrently stopping a slice of environments.
1414
// In this case, we want to log errors as they happen, not pass them through the callstack as errors.
15-
// When the operations complete, we want to log how many, if any, failed.
15+
// When the operations complete, we want to log how many, if any, failed. The caller is still expected
16+
// to handle success and info logging.
1617
typeErrGroupinterface {
1718
Go(ffunc()error)
1819
Wait()error
@@ -23,8 +24,8 @@ type group struct {
2324
failuresint32
2425
}
2526

26-
//NewErrGroup gives an error group with logging and error propagation handled automatically.
27-
funcNewErrGroup()ErrGroup {
27+
//LoggedErrGroup gives an error group with error logging and error propagation handled automatically.
28+
funcLoggedErrGroup()ErrGroup {
2829
return&group{
2930
egroup: errgroup.Group{},
3031
failures:0,

‎internal/cmd/envs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ coder envs --user charlie@coder.com ls -o json \
100100
returnxerrors.Errorf("new client: %w",err)
101101
}
102102

103-
egroup:=clog.NewErrGroup()
103+
egroup:=clog.LoggedErrGroup()
104104
for_,envName:=rangeargs {
105105
envName:=envName
106106
egroup.Go(func()error {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp