add testable json marshaller (#161)
This commit is contained in:
15
marshaller.go
Normal file
15
marshaller.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package openai
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type marshaller interface {
|
||||
marshal(value any) ([]byte, error)
|
||||
}
|
||||
|
||||
type jsonMarshaller struct{}
|
||||
|
||||
func (jm *jsonMarshaller) marshal(value any) ([]byte, error) {
|
||||
return json.Marshal(value)
|
||||
}
|
||||
Reference in New Issue
Block a user