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

Unified Diff: common/config/validation/validation.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits Created 3 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 | « common/config/impl/filesystem/paths.go ('k') | common/data/text/stringtemplate/template.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/config/validation/validation.go
diff --git a/common/config/validation/validation.go b/common/config/validation/validation.go
index 6263fecfb5fafb80bf430378df6e0799355b8967..ace7138f79d4cff9c4bbe6b7ee1533b24d8cbf3d 100644
--- a/common/config/validation/validation.go
+++ b/common/config/validation/validation.go
@@ -46,7 +46,9 @@ type Context struct {
type fileTagType struct{ Key errors.TagKey }
-func (f fileTagType) With(name string) errors.TagValue { return errors.MkTagValue(f.Key, name) }
+func (f fileTagType) With(name string) errors.TagValue {
+ return errors.TagValue{Key: f.Key, Value: name}
+}
func (f fileTagType) In(err error) (v string, ok bool) {
d, ok := errors.TagValueIn(f.Key, err)
if ok {
@@ -58,7 +60,7 @@ func (f fileTagType) In(err error) (v string, ok bool) {
type elementTagType struct{ Key errors.TagKey }
func (e elementTagType) With(elements []string) errors.TagValue {
- return errors.MkTagValue(e.Key, append([]string(nil), elements...))
+ return errors.TagValue{Key: e.Key, Value: append([]string(nil), elements...)}
}
func (e elementTagType) In(err error) (v []string, ok bool) {
d, ok := errors.TagValueIn(e.Key, err)
« no previous file with comments | « common/config/impl/filesystem/paths.go ('k') | common/data/text/stringtemplate/template.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698