From 3a266241c2a0fdab3ba129541672293b939067e4 Mon Sep 17 00:00:00 2001 From: Max Altgelt Date: Tue, 23 Jun 2026 09:01:27 +0000 Subject: [PATCH] fix: remove unnecessary methods Now that references properly resolve in slices, the string lists no longer need to implement a custom resolver. --- thorlog/v3/stringlist.go | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/thorlog/v3/stringlist.go b/thorlog/v3/stringlist.go index da70bf4..fe6a4fe 100644 --- a/thorlog/v3/stringlist.go +++ b/thorlog/v3/stringlist.go @@ -1,11 +1,7 @@ package thorlog import ( - "strconv" "strings" - - "github.com/NextronSystems/jsonlog" - "github.com/NextronSystems/jsonlog/jsonpointer" ) // StringList is a list of strings with a comma-separated string representation. @@ -17,21 +13,6 @@ func (s StringList) String() string { return strings.Join(s, ", ") } -var _ jsonlog.JsonReferenceResolver = StringList{} - -func (s StringList) RelativeJsonPointer(pointee any) jsonpointer.Pointer { - stringPointer, isStringPointer := pointee.(*string) - if !isStringPointer { - return nil - } - for i := range s { - if &s[i] == stringPointer { - return jsonpointer.New(strconv.Itoa(i)) - } - } - return nil -} - // ArrowStringList is a list of strings with an arrow-separated string representation. // // Note: ArrowStringList does not implement TextReferenceResolver. We do not @@ -43,18 +24,3 @@ type ArrowStringList []string func (a ArrowStringList) String() string { return strings.Join(a, ">") } - -var _ jsonlog.JsonReferenceResolver = ArrowStringList{} - -func (a ArrowStringList) RelativeJsonPointer(pointee any) jsonpointer.Pointer { - stringPointer, isStringPointer := pointee.(*string) - if !isStringPointer { - return nil - } - for i := range a { - if &a[i] == stringPointer { - return jsonpointer.New(strconv.Itoa(i)) - } - } - return nil -}