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/info.go

Issue 1766593002: Add a MustNamespace that panics if the namespace wasn't valid (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Add MustNamespace to the interface Created 4 years, 9 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/dummy/dummy.go ('k') | impl/memory/info_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/info.go
diff --git a/impl/memory/info.go b/impl/memory/info.go
index 811e586c3ebdb459bef06e20e4a2fc0ec32ac9de..6d28d5ab45478255432528ab560d1442b1c8b766 100644
--- a/impl/memory/info.go
+++ b/impl/memory/info.go
@@ -56,6 +56,14 @@ func (gi *giImpl) Namespace(ns string) (ret context.Context, err error) {
return context.WithValue(gi.c, giContextKey, &globalInfoData{gi.appid, ns}), nil
}
+func (gi *giImpl) MustNamespace(ns string) context.Context {
+ ret, err := gi.Namespace(ns)
+ if err != nil {
+ panic(err)
+ }
+ return ret
+}
+
func (gi *giImpl) AppID() string {
return gi.appid
}
« no previous file with comments | « impl/dummy/dummy.go ('k') | impl/memory/info_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698