Skip to content
Merged
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
34 changes: 0 additions & 34 deletions thorlog/v3/stringlist.go
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand All @@ -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
}
Loading