]> Cypherpunks.ru repositories - gostls13.git/commitdiff
net/http: remove unused ResponseWriter params
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 6 Mar 2017 09:54:27 +0000 (10:54 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 6 Mar 2017 23:46:56 +0000 (23:46 +0000)
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>

src/net/http/fs.go

index 2858319450520c881884981f67563d97c2b54237..c331cb5ac4ae647af3ab5877c8170e6975557be7 100644 (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
                }