From be24d82c088b195fbb01dc940d94d81c4b7e74c2 Mon Sep 17 00:00:00 2001 From: Bart Van Bos Date: Sat, 7 Nov 2026 23:26:03 +0100 Subject: [PATCH] test: drop the unreachable error branch in buildinfo JSON json.Marshal cannot fail for Info, so the panic branch was dead code that Codecov reported as an uncovered patch line. Co-Authored-By: Claude Opus 5.5 --- internal/buildinfo/buildinfo.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/buildinfo/buildinfo.go b/internal/buildinfo/buildinfo.go index 40030da..293839a 100644 --- a/internal/buildinfo/buildinfo.go +++ b/internal/buildinfo/buildinfo.go @@ -110,10 +110,7 @@ func (i Info) JSON() string { if i.Libraries == nil { i.Libraries = []Library{} } - data, err := json.Marshal(i) - if err != nil { // a struct of strings always encodes - panic(err) - } + data, _ := json.Marshal(i) // a struct of strings and string slices always encodes return string(data) }