16 lines
235 B
Go
16 lines
235 B
Go
package common
|
|
|
|
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)
|
|
}
|