diff --git a/storage/Decoder.go b/storage/Decoder.go deleted file mode 100644 index 40fd580..0000000 --- a/storage/Decoder.go +++ /dev/null @@ -1,12 +0,0 @@ -package storage - -import ( - "encoding/json" - "io" -) - -var NewDecoder = func(r io.Reader) Decoder { return json.NewDecoder(r) } - -type Decoder interface { - Decode(any) error -} diff --git a/storage/Encoder.go b/storage/Encoder.go deleted file mode 100644 index fcda929..0000000 --- a/storage/Encoder.go +++ /dev/null @@ -1,12 +0,0 @@ -package storage - -import ( - "encoding/json" - "io" -) - -var NewEncoder = func(w io.Writer) Encoder { return json.NewEncoder(w) } - -type Encoder interface { - Encode(any) error -} diff --git a/storage/File.go b/storage/File.go index c49e542..e5bd347 100644 --- a/storage/File.go +++ b/storage/File.go @@ -173,7 +173,7 @@ func (fs *File[T]) writeTo(writer io.Writer) error { return records[i].key < records[j].key }) - encoder := NewEncoder(writer) + encoder := json.NewEncoder(writer) for _, record := range records { _, err := stringWriter.WriteString(record.key)