1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-18 04:40:03 +02:00

transport/message/encoder.go: remove Encode() function.

This commit is contained in:
Henrik Hautakoski 2023-02-10 16:50:59 +01:00
parent 55f013a386
commit a20295ee88

View file

@ -1,21 +1,4 @@
package message
import (
"encoding/json"
log "github.com/sirupsen/logrus"
)
// Encoder is a function that can encode a object to the encoded format.
type Encoder func(v any) ([]byte, error)
func Encode(v interface{}) ([]byte, bool) {
payload, err := json.Marshal(v)
if err != nil {
log.WithError(err).
WithField("v", v).
Warn("Failed to encode message to json")
return nil, false
}
return payload, true
}