Skip to content

Commit

Permalink
sumdb: sync change from cmd/go internal package
Browse files Browse the repository at this point in the history
Copy change in CL 203607 from cmd/go/internal/sumdb to
golang.org/x/mod/sumdb. This just removed an unused parameter. These
packages should be identical (except for imports) before
cmd/go/internal/sumdb is deleted in CL 202698.

Updates golang/go#31761

Change-Id: I1ce96d66bc71ef5c9515b68811049c47dce97765
Reviewed-on: https://go-review.googlesource.com/c/mod/+/204138
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
Jay Conrod committed Oct 29, 2019
1 parent 8ecbfe1 commit 18c3998
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sumdb/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
escPath, escVers := mod[:i], mod[i+1:]
path, err := module.UnescapePath(escPath)
if err != nil {
reportError(w, r, err)
reportError(w, err)
return
}
vers, err := module.UnescapeVersion(escVers)
if err != nil {
reportError(w, r, err)
reportError(w, err)
return
}
id, err := s.ops.Lookup(ctx, module.Version{Path: path, Version: vers})
if err != nil {
reportError(w, r, err)
reportError(w, err)
return
}
records, err := s.ops.ReadRecords(ctx, id, 1)
Expand Down Expand Up @@ -137,7 +137,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
start := t.N << uint(t.H)
records, err := s.ops.ReadRecords(ctx, start, int64(t.W))
if err != nil {
reportError(w, r, err)
reportError(w, err)
return
}
if len(records) != t.W {
Expand All @@ -159,7 +159,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {

data, err := s.ops.ReadTileData(ctx, t)
if err != nil {
reportError(w, r, err)
reportError(w, err)
return
}
w.Header().Set("Content-Type", "application/octet-stream")
Expand All @@ -172,7 +172,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Otherwise it is an internal server error.
// The caller must only call reportError in contexts where
// a not-found err should be reported as 404.
func reportError(w http.ResponseWriter, r *http.Request, err error) {
func reportError(w http.ResponseWriter, err error) {
if os.IsNotExist(err) {
http.Error(w, err.Error(), http.StatusNotFound)
return
Expand Down

0 comments on commit 18c3998

Please sign in to comment.