Chromium Code Reviews| Index: milo/appengine/buildbot/build.go |
| diff --git a/milo/appengine/buildbot/build.go b/milo/appengine/buildbot/build.go |
| index 252f0ef4c3ee02e5d264add8a4cf26a9975798f8..c6f7e0c977bd902aaa08dbc5e956b1119dfebc83 100644 |
| --- a/milo/appengine/buildbot/build.go |
| +++ b/milo/appengine/buildbot/build.go |
| @@ -6,29 +6,24 @@ package buildbot |
| import ( |
| "encoding/json" |
| + "errors" |
| "fmt" |
| "io/ioutil" |
| - "net/http" |
| "path/filepath" |
| "regexp" |
| "sort" |
| "strings" |
| "time" |
| + "golang.org/x/net/context" |
| + |
| + "github.com/luci/gae/service/datastore" |
| "github.com/luci/luci-go/common/data/stringset" |
| "github.com/luci/luci-go/common/logging" |
| "github.com/luci/luci-go/milo/api/resp" |
| - "github.com/luci/luci-go/milo/common/miloerror" |
| - |
| - ds "github.com/luci/gae/service/datastore" |
| - |
| - "golang.org/x/net/context" |
| ) |
| -var errBuildNotFound = miloerror.Error{ |
| - Message: "Build not found", |
| - Code: http.StatusNotFound, |
| -} |
| +var errBuildNotFound = errors.New("Build not found") |
|
nodir
2017/03/20 19:11:36
error messages in Go should start with a non-capit
hinoka
2017/03/20 19:16:31
Acknowledged.
|
| // getBuild fetches a buildbot build from the datastore and checks ACLs. |
| // The return code matches the master responses. |
| @@ -39,7 +34,7 @@ func getBuild(c context.Context, master, builder string, buildNum int) (*buildbo |
| Number: buildNum, |
| } |
| - err := ds.Get(c, result) |
| + err := datastore.Get(c, result) |
| err = checkAccess(c, err, result.Internal) |
| if err == errMasterNotFound { |
| err = errBuildNotFound |