| 1234567891011121314151617181920212223242526 |
- package common
- import (
- jsoniter "git.ikuban.com/server/json"
- "google.golang.org/protobuf/types/known/structpb"
- )
- var json = jsoniter.ConfigCompatibleWithStandardLibrary
- func MarshalJSON(v interface{}) []byte {
- j, _ := json.Marshal(v)
- return j
- }
- func NewStructValuePB(v interface{}) *structpb.Value {
- s := new(structpb.Value)
- s.UnmarshalJSON(MarshalJSON(v))
- return s
- }
- func NewStructValuePBByBytes(v []byte) *structpb.Value {
- s := new(structpb.Value)
- s.UnmarshalJSON(v)
- return s
- }
|