Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: impl/memory/module.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/memcache_test.go ('k') | impl/memory/module_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/module.go
diff --git a/impl/memory/module.go b/impl/memory/module.go
index 0d67f42f9ad87b7d94e450641c417c892929d0ce..3a456902082dedfd04d4b7fcfc6c7836223dc548 100644
--- a/impl/memory/module.go
+++ b/impl/memory/module.go
@@ -18,18 +18,18 @@ type moduleVersion struct {
}
type modImpl struct {
- c context.Context
numInstances map[moduleVersion]int
}
// useMod adds a Module interface to the context
func useMod(c context.Context) context.Context {
- return module.SetFactory(c, func(ic context.Context) module.Interface {
- return &modImpl{ic, map[moduleVersion]int{}}
+ modMap := map[moduleVersion]int{}
+ return module.SetFactory(c, func(ic context.Context) module.RawInterface {
+ return &modImpl{modMap}
})
}
-var _ = module.Interface((*modImpl)(nil))
+var _ = module.RawInterface((*modImpl)(nil))
func (mod *modImpl) List() ([]string, error) {
return []string{"testModule1", "testModule2"}, nil
@@ -55,10 +55,5 @@ func (mod *modImpl) DefaultVersion(module string) (string, error) {
return "testVersion1", nil
}
-func (mod *modImpl) Start(module, version string) error {
- return nil
-}
-
-func (mod *modImpl) Stop(module, version string) error {
- return nil
-}
+func (mod *modImpl) Start(module, version string) error { return nil }
+func (mod *modImpl) Stop(module, version string) error { return nil }
« no previous file with comments | « impl/memory/memcache_test.go ('k') | impl/memory/module_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698