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

Unified Diff: service/info/wrapper.go

Issue 2062613002: Add TrimmedAppID to info service. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 6 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 | « service/info/interface.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/info/wrapper.go
diff --git a/service/info/wrapper.go b/service/info/wrapper.go
new file mode 100644
index 0000000000000000000000000000000000000000..76f84af2f7e592dc19bc947994af05b6c420ab22
--- /dev/null
+++ b/service/info/wrapper.go
@@ -0,0 +1,30 @@
+// Copyright 2016 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package info
+
+import (
+ "strings"
+
+ "golang.org/x/net/context"
+)
+
+type infoImpl struct {
+ RawInterface
+}
+
+var _ Interface = infoImpl{}
+
+func (i infoImpl) MustNamespace(namespace string) context.Context {
dnj (Google) 2016/06/11 02:47:38 Any reason *not* to make this a pointer receiver?
iannucci 2016/06/14 00:01:08 double deref for no reason? additional opportuniti
+ ret, err := i.Namespace(namespace)
+ if err != nil {
+ panic(err)
+ }
+ return ret
+}
+
+func (i infoImpl) TrimmedAppID() string {
+ toks := strings.Split(i.AppID(), ":")
+ return toks[len(toks)-1]
+}
« no previous file with comments | « service/info/interface.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698