groupcache icon indicating copy to clipboard operation
groupcache copied to clipboard

singleflight: Add an example

Open kevinburke opened this issue 9 years ago • 10 comments

I was curious about the best way to initialize a Group - it turns out you just do var g Group - but figured this package could use a package-level example demonstrating an example use case.

I've signed the CLA.

kevinburke avatar Oct 23 '16 06:10 kevinburke

Here's how the example looks on godoc on my machine:

kevinburke avatar Oct 26 '16 18:10 kevinburke

Check errors too.

bradfitz avatar Oct 26 '16 20:10 bradfitz

Done. Thank you for the review! And sorry for being so slow.

$ git rev-parse HEAD && go test ./...
8340abafe7a8d6b5443f502e62eb1d8e16198d52
ok      github.com/golang/groupcache    0.691s
ok      github.com/golang/groupcache/consistenthash 0.011s
?       github.com/golang/groupcache/groupcachepb   [no test files]
ok      github.com/golang/groupcache/lru    0.012s
ok      github.com/golang/groupcache/singleflight   0.119s
?       github.com/golang/groupcache/testpb [no test files]

kevinburke avatar Oct 28 '16 05:10 kevinburke

Copyright Google isn't right. You're not a Google employee I don't think?

I'd make it match the rest of Go and be copyright The Go Authors.

bradfitz avatar Oct 29 '16 17:10 bradfitz

Ah, sorry, I copied it from another file in that repo. Should I update the other file headers or just this one?

On Saturday, October 29, 2016, Brad Fitzpatrick [email protected] wrote:

Copyright Google isn't right. You're not a Google employee I don't think?

I'd make it match the rest of Go and be copyright The Go Authors.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/golang/groupcache/pull/73#issuecomment-257103736, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOSI_80N7g_J8gylOG7N65zuy3FtDVoks5q439egaJpZM4KeD5v .

Kevin Burke 925.271.7005 | kev.inburke.com

kevinburke avatar Oct 29 '16 17:10 kevinburke

Just one for now. Once a non-Googler touches other files they can update it.

bradfitz avatar Oct 29 '16 18:10 bradfitz

Done

kevinburke avatar Oct 30 '16 18:10 kevinburke

Looks like you still have that data race to fix, @kevinburke :-)

hblanks avatar Dec 22 '16 15:12 hblanks

Yikes. I think I forgot to push my branch months ago when I left this comment. Let me double check

On Thu, Dec 22, 2016 at 07:28 Hunter Blanks [email protected] wrote:

Looks like you still have that data race to fix, @kevinburke https://github.com/kevinburke :-)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/golang/groupcache/pull/73#issuecomment-268822705, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOSI6xQFVCqigIGlirJsqVwTgCfC0r-ks5rKpcOgaJpZM4KeD5v .

kevinburke avatar Dec 22 '16 15:12 kevinburke

Apologies for the delay, but I've finally made the changes you requested.

kevinburke avatar Mar 26 '18 22:03 kevinburke