You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package message
|
|
|
|
import "git.noahlan.cn/northlan/ngs/internal/env"
|
|
|
|
func Serialize(v interface{}) ([]byte, error) {
|
|
if data, ok := v.([]byte); ok {
|
|
return data, nil
|
|
}
|
|
data, err := env.Serializer.Marshal(v)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data, nil
|
|
}
|