Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ func Test_Root(t *testing.T) {
statusCode int
}{
{"ok", parseCertificate(rootPEM), nil, "", 200},
{"fail", nil, fmt.Errorf("not found"), fmt.Sprintf("root certificate with fingerprint %q was not found", sha), 404},
{"fail", nil, fmt.Errorf("not found"), fmt.Sprintf(`root certificate with fingerprint \"%s\" was not found`, sha), 404},
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manual escaping of quotes with backslashes is unnecessary and makes the test harder to read. Since the format string is already using backticks (raw string literal), you can include the quotes directly without escaping: root certificate with fingerprint \"%s\" was not found should be root certificate with fingerprint \"%s\" was not found or use double quotes with proper escaping if needed based on how the actual error message is formatted.

Suggested change
{"fail", nil, fmt.Errorf("not found"), fmt.Sprintf(`root certificate with fingerprint \"%s\" was not found`, sha), 404},
{"fail", nil, fmt.Errorf("not found"), fmt.Sprintf(`root certificate with fingerprint "%s" was not found`, sha), 404},

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@hslatman hslatman Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but that is the wrong conclusion, Copilot.

}

// Request with chi context
Expand Down
2 changes: 1 addition & 1 deletion ca/ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ func TestCARoot(t *testing.T) {
ca: ca,
sha: "foo",
status: http.StatusNotFound,
errMsg: errs.NotFoundDefaultMsg,
errMsg: `root certificate with fingerprint "foo" was not found`,
}
},
"success": func(t *testing.T) *rootTest {
Expand Down