From 95784822ce2e6302be6208a1f4492f272ae50f4a Mon Sep 17 00:00:00 2001 From: anthonyrawlins Date: Sun, 21 Sep 2025 17:16:38 +1000 Subject: [PATCH] fix(logging): resolve duplicate type case compilation error in hypercore.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @goal: CHORUS-REQ-001 - Fix critical compilation error blocking development - Remove duplicate type cases for interface{}/any and []interface{}/[]any - Go 1.18+ treats interface{} and any as identical types - Standardize on 'any' type for consistency with modern Go practices - Add proper type conversion for cloneLogMap compatibility - Include requirement traceability comments Fixes: CHORUS issue #1 Test: go build ./internal/logging/... passes without errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- internal/logging/hypercore.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/logging/hypercore.go b/internal/logging/hypercore.go index fac1689..967f154 100644 --- a/internal/logging/hypercore.go +++ b/internal/logging/hypercore.go @@ -371,18 +371,17 @@ func cloneLogMap(in map[string]interface{}) map[string]interface{} { return out } +// @goal: CHORUS-REQ-001 - Fix duplicate type case compilation error +// WHY: Go 1.18+ treats interface{} and any as identical types, causing duplicate case errors func cloneLogValue(v interface{}) interface{} { switch tv := v.(type) { - case map[string]interface{}: - return cloneLogMap(tv) case map[string]any: + // @goal: CHORUS-REQ-001 - Convert any to interface{} for cloneLogMap compatibility converted := make(map[string]interface{}, len(tv)) for k, val := range tv { - converted[k] = cloneLogValue(val) + converted[k] = val } - return converted - case []interface{}: - return cloneLogSlice(tv) + return cloneLogMap(converted) case []any: converted := make([]interface{}, len(tv)) for i, val := range tv {