Skip to content

Commit

Permalink
ignoring current errcheck linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Maed223 committed Oct 31, 2024
1 parent 63380ca commit 6829997
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion disco/disco_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func TestDiscover(t *testing.T) {
`)
w.Header().Add("Content-Type", "application/json")
w.Header().Add("Content-Length", strconv.Itoa(len(resp)))
//nolint:errcheck
w.Write(resp)
})
defer close()
Expand Down Expand Up @@ -77,8 +78,10 @@ func TestDiscover(t *testing.T) {
// We're going to force chunked encoding here -- and thus prevent
// the server from predicting the length -- so we can make sure
// our client is tolerant of servers using this encoding.
//nolint:errcheck
w.Write(resp[:5])
w.(http.Flusher).Flush()
//nolint:errcheck
w.Write(resp[5:])
w.(http.Flusher).Flush()
})
Expand Down Expand Up @@ -130,6 +133,7 @@ func TestDiscover(t *testing.T) {
"token": "abc123",
},
}))
//nolint:errcheck
d.Discover(host)
if got, want := authHeaderText, "Bearer abc123"; got != want {
t.Fatalf("wrong Authorization header\ngot: %s\nwant: %s", got, want)
Expand Down Expand Up @@ -297,7 +301,7 @@ func TestDiscover(t *testing.T) {
}

d := New()

//nolint:errcheck
transport := d.Transport.(*http.Transport)

origTimeout := transport.ResponseHeaderTimeout
Expand Down Expand Up @@ -449,6 +453,7 @@ func testServer(h func(w http.ResponseWriter, r *http.Request)) (portStr string,
},
))

//nolint:errcheck
serverURL, _ := url.Parse(server.URL)

portStr = serverURL.Port()
Expand Down
2 changes: 2 additions & 0 deletions disco/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
)

func TestHostServiceURL(t *testing.T) {
//nolint:errcheck
baseURL, _ := url.Parse("https://example.com/disco/foo.json")
host := Host{
discoURL: baseURL,
Expand Down Expand Up @@ -74,6 +75,7 @@ func TestHostServiceURL(t *testing.T) {
}

func TestHostServiceOAuthClient(t *testing.T) {
//nolint:errcheck
baseURL, _ := url.Parse("https://example.com/disco/foo.json")
host := Host{
discoURL: baseURL,
Expand Down
1 change: 1 addition & 0 deletions svchost.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func ForDisplay(given string) string {
if colonPos := strings.Index(given, ":"); colonPos != -1 {
given, portPortion = given[:colonPos], given[colonPos:]
}
//nolint:errcheck
portPortion, _ = normalizePortPortion(portPortion)

ascii, err := displayProfile.ToASCII(given)
Expand Down

0 comments on commit 6829997

Please sign in to comment.