Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit eb618aa

Browse files
committed
fixup! Add new clog.ErrGroup
1 parent 99a751f commit eb618aa

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
type ErrGroup interface {
1718
Go(f func() error)
1819
Wait() error
@@ -23,8 +24,8 @@ type group struct {
2324
failures int32
2425
}
2526

26-
// NewErrGroup gives an error group with logging and error propagation handled automatically.
27-
func NewErrGroup() ErrGroup {
27+
// LoggedErrGroup gives an error group with error logging and error propagation handled automatically.
28+
func LoggedErrGroup() 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
return xerrors.Errorf("new client: %w", err)
101101
}
102102

103-
egroup := clog.NewErrGroup()
103+
egroup := clog.LoggedErrGroup()
104104
for _, envName := range args {
105105
envName := envName
106106
egroup.Go(func() error {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy