From 79760344e7b1231e59a2867246e7689b05e92e18 Mon Sep 17 00:00:00 2001 From: Echsecutor Date: Thu, 1 Sep 2016 14:43:05 +0200 Subject: [PATCH] fixing ineffectual assignments --- caddyhttp/browse/browse_test.go | 2 +- caddyhttp/fastcgi/fcgiclient.go | 2 +- caddyhttp/staticfiles/fileserver.go | 2 +- caddyhttp/staticfiles/fileserver_test.go | 2 +- caddytls/client.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/caddyhttp/browse/browse_test.go b/caddyhttp/browse/browse_test.go index eb200d3f..3ac3f49c 100644 --- a/caddyhttp/browse/browse_test.go +++ b/caddyhttp/browse/browse_test.go @@ -300,7 +300,7 @@ func TestBrowseJson(t *testing.T) { req.Header.Set("Accept", "application/json") rec := httptest.NewRecorder() - code, err := b.ServeHTTP(rec, req) + code, _ := b.ServeHTTP(rec, req) if code != http.StatusOK { t.Fatalf("In test %d: Wrong status, expected %d, got %d", i, http.StatusOK, code) diff --git a/caddyhttp/fastcgi/fcgiclient.go b/caddyhttp/fastcgi/fcgiclient.go index 574455c6..5d16a9c9 100644 --- a/caddyhttp/fastcgi/fcgiclient.go +++ b/caddyhttp/fastcgi/fcgiclient.go @@ -545,7 +545,7 @@ func (c *FCGIClient) PostFile(p map[string]string, data url.Values, file map[str if e != nil { return nil, e } - _, err = io.Copy(part, fd) + io.Copy(part, fd) } err = writer.Close() diff --git a/caddyhttp/staticfiles/fileserver.go b/caddyhttp/staticfiles/fileserver.go index 99ef406a..8baa530d 100644 --- a/caddyhttp/staticfiles/fileserver.go +++ b/caddyhttp/staticfiles/fileserver.go @@ -103,7 +103,7 @@ func (fs FileServer) serveFile(w http.ResponseWriter, r *http.Request, name stri defer ff.Close() dd, err := ff.Stat() if err == nil { - name = index + //name = index //ineffectual d = dd f = ff break diff --git a/caddyhttp/staticfiles/fileserver_test.go b/caddyhttp/staticfiles/fileserver_test.go index 6c77cec1..d92733ac 100644 --- a/caddyhttp/staticfiles/fileserver_test.go +++ b/caddyhttp/staticfiles/fileserver_test.go @@ -162,7 +162,7 @@ func TestServeHTTP(t *testing.T) { for i, test := range tests { responseRecorder := httptest.NewRecorder() - request, err := http.NewRequest("GET", test.url, nil) + request, _ := http.NewRequest("GET", test.url, nil) // prevent any URL sanitization within Go: we need unmodified paths here if u, _ := url.Parse(test.url); u.RawPath != "" { request.URL.Path = u.RawPath diff --git a/caddytls/client.go b/caddytls/client.go index 97393195..0cf45b80 100644 --- a/caddytls/client.go +++ b/caddytls/client.go @@ -55,7 +55,7 @@ var newACMEClient = func(config *Config, allowPrompts bool) (*ACMEClient, error) if !strings.Contains(caURL, "://") { caURL = "https://" + caURL } - u, err := url.Parse(caURL) + u, _ := url.Parse(caURL) if u.Scheme != "https" && !caddy.IsLoopback(u.Host) && !strings.HasPrefix(u.Host, "10.") { return nil, fmt.Errorf("%s: insecure CA URL (HTTPS required)", caURL) }