Skip to content

Commit 55a4369

Browse files
committed
feedback on import
1 parent 682143f commit 55a4369

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

singleflight/singleflight.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
// mechanism.
77
package singleflight // import "golang.org/x/sync/singleflight"
88

9-
import "sync"
10-
import "sync/atomic"
9+
import (
10+
"sync"
11+
"sync/atomic"
12+
)
1113

1214
// call is an in-flight or completed singleflight.Do call
1315
type call struct {
@@ -44,7 +46,7 @@ type Result struct {
4446
Shared RefShared
4547
}
4648

47-
// this encapsulates both "shared boolean" as well as actual reference counter
49+
// RefShared struct encapsulates both "shared boolean" as well as actual reference counter
4850
// callers can call RefShared.Decrement to determine when last caller is done using result, so cleanup if needed can be performed
4951
type RefShared struct {
5052
shared bool
@@ -105,7 +107,6 @@ func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) {
105107
if !c.forgotten {
106108
delete(g.m, key)
107109
}
108-
//shared := newRefShared(&c.refCount)
109110
shared := RefShared{shared: c.refCount > 1, refCount: &c.refCount}
110111
for _, ch := range c.chans {
111112
ch <- Result{c.val, c.err, shared}

0 commit comments

Comments
 (0)