Fix some lint and vet issues

This commit is contained in:
Pim van Pelt
2025-08-28 21:17:37 +02:00
parent 7b3639ad69
commit 105a245239
10 changed files with 47 additions and 41 deletions

View File

@@ -29,7 +29,7 @@ func TestGenerateRoots(t *testing.T) {
if !strings.HasSuffix(r.URL.Path, "/ct/v1/get-roots") {
t.Errorf("Expected path to end with /ct/v1/get-roots, got %s", r.URL.Path)
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(mockResponse)
}))
@@ -51,7 +51,7 @@ func TestGenerateRoots(t *testing.T) {
}
contentStr := string(content)
// Should contain PEM headers
if !strings.Contains(contentStr, "-----BEGIN CERTIFICATE-----") {
t.Error("Expected PEM certificate headers")
@@ -152,7 +152,7 @@ func TestGenerateRootsSourceURLFormatting(t *testing.T) {
if r.URL.Path != expectedPath {
t.Errorf("Expected path %s, got %s", expectedPath, r.URL.Path)
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(mockResponse)
}))
@@ -202,11 +202,11 @@ func TestPEMEncoding(t *testing.T) {
if block == nil {
break
}
if block.Type != "CERTIFICATE" {
t.Errorf("Expected block type 'CERTIFICATE', got %s", block.Type)
}
certCount++
remaining = rest
}
@@ -214,4 +214,4 @@ func TestPEMEncoding(t *testing.T) {
if certCount != 1 {
t.Errorf("Expected 1 certificate, found %d", certCount)
}
}
}