fix(logging): resolve duplicate type case compilation error in hypercore.go
@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 <noreply@anthropic.com>
This commit is contained in:
@@ -371,18 +371,17 @@ func cloneLogMap(in map[string]interface{}) map[string]interface{} {
|
|||||||
return out
|
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{} {
|
func cloneLogValue(v interface{}) interface{} {
|
||||||
switch tv := v.(type) {
|
switch tv := v.(type) {
|
||||||
case map[string]interface{}:
|
|
||||||
return cloneLogMap(tv)
|
|
||||||
case map[string]any:
|
case map[string]any:
|
||||||
|
// @goal: CHORUS-REQ-001 - Convert any to interface{} for cloneLogMap compatibility
|
||||||
converted := make(map[string]interface{}, len(tv))
|
converted := make(map[string]interface{}, len(tv))
|
||||||
for k, val := range tv {
|
for k, val := range tv {
|
||||||
converted[k] = cloneLogValue(val)
|
converted[k] = val
|
||||||
}
|
}
|
||||||
return converted
|
return cloneLogMap(converted)
|
||||||
case []interface{}:
|
|
||||||
return cloneLogSlice(tv)
|
|
||||||
case []any:
|
case []any:
|
||||||
converted := make([]interface{}, len(tv))
|
converted := make([]interface{}, len(tv))
|
||||||
for i, val := range tv {
|
for i, val := range tv {
|
||||||
|
|||||||
Reference in New Issue
Block a user