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

Unified Diff: cipd/client/cipd/ensure/template.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: all tests passing 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
Index: cipd/client/cipd/ensure/template.go
diff --git a/cipd/client/cipd/ensure/template.go b/cipd/client/cipd/ensure/template.go
index 49342978068d3522d5adc4a65fb61513932cec44..199179c9e258d65c048187535d1814863e74587f 100644
--- a/cipd/client/cipd/ensure/template.go
+++ b/cipd/client/cipd/ensure/template.go
@@ -34,14 +34,13 @@ func expandTemplate(template string, expansionLookup map[string]string) (pkg str
return value
}
- err = errors.Reason("unknown variable in ${%(contents)s}").
- D("contents", contents).Err()
+ err = errors.Reason("unknown variable in ${%s}", contents).Err()
}
// ${varName=value,value}
ourValue, ok := expansionLookup[varNameValues[0]]
if !ok {
- err = errors.Reason("unknown variable %(parm)q").D("parm", parm).Err()
+ err = errors.Reason("unknown variable %q", parm).Err()
return parm
}
@@ -57,8 +56,7 @@ func expandTemplate(template string, expansionLookup map[string]string) (pkg str
err = errSkipTemplate
}
if err == nil && strings.ContainsRune(pkg, '$') {
- err = errors.Reason("unable to process some variables in %(template)q").
- D("template", template).Err()
+ err = errors.Reason("unable to process some variables in %q", template).Err()
}
if err == nil {
err = common.ValidatePackageName(pkg)

Powered by Google App Engine
This is Rietveld 408576698