Skip to content

Commit 18c3998

Browse files
author
Jay Conrod
committed
sumdb: sync change from cmd/go internal package
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>
1 parent 8ecbfe1 commit 18c3998

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sumdb/server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
8080
escPath, escVers := mod[:i], mod[i+1:]
8181
path, err := module.UnescapePath(escPath)
8282
if err != nil {
83-
reportError(w, r, err)
83+
reportError(w, err)
8484
return
8585
}
8686
vers, err := module.UnescapeVersion(escVers)
8787
if err != nil {
88-
reportError(w, r, err)
88+
reportError(w, err)
8989
return
9090
}
9191
id, err := s.ops.Lookup(ctx, module.Version{Path: path, Version: vers})
9292
if err != nil {
93-
reportError(w, r, err)
93+
reportError(w, err)
9494
return
9595
}
9696
records, err := s.ops.ReadRecords(ctx, id, 1)
@@ -137,7 +137,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
137137
start := t.N << uint(t.H)
138138
records, err := s.ops.ReadRecords(ctx, start, int64(t.W))
139139
if err != nil {
140-
reportError(w, r, err)
140+
reportError(w, err)
141141
return
142142
}
143143
if len(records) != t.W {
@@ -159,7 +159,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
159159

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

0 commit comments

Comments
 (0)