Check error returns to satisfy errcheck lint
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

This commit is contained in:
benvin
2026-07-25 10:00:07 +10:00
parent e200c0f7d2
commit 7f8ca8046e
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -92,7 +92,7 @@ func TestFetchTimeout(t *testing.T) {
client := &http.Client{Timeout: 20 * time.Millisecond}
resp, err := client.Get(srv.URL + "/cblr/svc/op/puppet/hostname/host.example")
if err == nil {
resp.Body.Close()
_ = resp.Body.Close()
t.Fatalf("expected timeout error, got none")
}
}
@@ -119,7 +119,9 @@ func TestRunVersion(t *testing.T) {
func TestDefaultBaseURLCompiledIn(t *testing.T) {
// Guard against accidental changes to the in-cluster default.
os.Unsetenv("ENCAPI_URL")
if err := os.Unsetenv("ENCAPI_URL"); err != nil {
t.Fatalf("unsetenv: %v", err)
}
if defaultBaseURL != "http://encapi.encapi.svc.cluster.local" {
t.Errorf("defaultBaseURL = %q", defaultBaseURL)
}