1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:54:57 -07:00

net/http: remove unused ResponseWriter params

Found by github.com/mvdan/unparam.

Change-Id: I66f5a191cf9c9a11a7c3c4d7ee0a02e2c185f019
Reviewed-on: https://go-review.googlesource.com/37841
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Daniel Martí 2017-03-06 10:54:27 +01:00 committed by Brad Fitzpatrick
parent d10b50dc34
commit cd6f18779f

View File

@ -373,7 +373,7 @@ func checkIfMatch(w ResponseWriter, r *Request) condResult {
return condFalse
}
func checkIfUnmodifiedSince(w ResponseWriter, r *Request, modtime time.Time) condResult {
func checkIfUnmodifiedSince(r *Request, modtime time.Time) condResult {
ius := r.Header.Get("If-Unmodified-Since")
if ius == "" || isZeroTime(modtime) {
return condNone
@ -418,7 +418,7 @@ func checkIfNoneMatch(w ResponseWriter, r *Request) condResult {
return condTrue
}
func checkIfModifiedSince(w ResponseWriter, r *Request, modtime time.Time) condResult {
func checkIfModifiedSince(r *Request, modtime time.Time) condResult {
if r.Method != "GET" && r.Method != "HEAD" {
return condNone
}
@ -503,7 +503,7 @@ func checkPreconditions(w ResponseWriter, r *Request, modtime time.Time) (done b
// This function carefully follows RFC 7232 section 6.
ch := checkIfMatch(w, r)
if ch == condNone {
ch = checkIfUnmodifiedSince(w, r, modtime)
ch = checkIfUnmodifiedSince(r, modtime)
}
if ch == condFalse {
w.WriteHeader(StatusPreconditionFailed)
@ -519,7 +519,7 @@ func checkPreconditions(w ResponseWriter, r *Request, modtime time.Time) (done b
return true, ""
}
case condNone:
if checkIfModifiedSince(w, r, modtime) == condFalse {
if checkIfModifiedSince(r, modtime) == condFalse {
writeNotModified(w)
return true, ""
}
@ -604,7 +604,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec
// Still a directory? (we didn't find an index.html file)
if d.IsDir() {
if checkIfModifiedSince(w, r, d.ModTime()) == condFalse {
if checkIfModifiedSince(r, d.ModTime()) == condFalse {
writeNotModified(w)
return
}