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

Unified Diff: deploytool/cmd/luci_deploy/staging.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 | « deploytool/cmd/luci_deploy/path.go ('k') | deploytool/cmd/luci_deploy/title.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: deploytool/cmd/luci_deploy/staging.go
diff --git a/deploytool/cmd/luci_deploy/staging.go b/deploytool/cmd/luci_deploy/staging.go
index f35c96e7a7d2c2199438361285c674307569bde1..de221903d79cf3c8d8ca5e43b1b03d4a89f0c40a 100644
--- a/deploytool/cmd/luci_deploy/staging.go
+++ b/deploytool/cmd/luci_deploy/staging.go
@@ -36,8 +36,7 @@ func stageGoPath(w *work, comp *layoutDeploymentComponent, root *managedfs.Dir)
for _, gopath := range src.InitResult.GoPath {
// Make sure our Go package isn't a directory.
if _, ok := dirs[gopath.GoPackage]; ok {
- return errors.Reason("GOPATH %(package)q is both a package and directory").
- D("package", gopath.GoPackage).Err()
+ return errors.Reason("GOPATH %q is both a package and directory", gopath.GoPackage).Err()
}
// Check intermediate paths to make sure there isn't a deployment
@@ -45,8 +44,7 @@ func stageGoPath(w *work, comp *layoutDeploymentComponent, root *managedfs.Dir)
pkgParts := splitGoPackage(gopath.GoPackage)
for _, parentPkg := range pkgParts[:len(pkgParts)-1] {
if _, ok := build[parentPkg]; ok {
- return errors.Reason("GOPATH %(package)q is both a package and directory").
- D("package", parentPkg).Err()
+ return errors.Reason("GOPATH %q is both a package and directory", parentPkg).Err()
}
dirs[parentPkg] = struct{}{}
}
@@ -70,13 +68,12 @@ func stageGoPath(w *work, comp *layoutDeploymentComponent, root *managedfs.Dir)
var err error
d, err = d.EnsureDirectory(comp)
if err != nil {
- return errors.Annotate(err).Reason("could not create GOPATH parent directory [%(path)s]").
- D("path", d).Err()
+ return errors.Annotate(err, "could not create GOPATH parent directory [%s]", d).Err()
}
}
link := d.File(pkgComponents[len(pkgComponents)-1])
if err := link.SymlinkFrom(src, true); err != nil {
- return errors.Annotate(err).Reason("failed to create GOPATH link").Err()
+ return errors.Annotate(err, "failed to create GOPATH link").Err()
}
}
return nil
« no previous file with comments | « deploytool/cmd/luci_deploy/path.go ('k') | deploytool/cmd/luci_deploy/title.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698