background/utils/jsonbuilder.go

28 lines
513 B
Go
Raw Permalink Normal View History

2020-04-30 17:54:19 +00:00
package utils
import (
"github.com/pkg/errors"
"reflect"
)
// to simplefy add json
type JsonObject struct{
parent *JsonObject
child *JsonObject
value interface{}
}
func (*JsonObject)InsertObj(key string,obj interface{}) error{
if reflect.TypeOf(obj).Kind() != reflect.Map{
return errors.New("wrong parameter")
}
return nil
}
func (*JsonObject)InsertArrary(key string,arr interface{}) error {
if reflect.TypeOf(arr).Kind() != reflect.Array{
return errors.New("wrong parameter")
}
2020-05-01 13:21:04 +00:00
return nil
2020-04-30 17:54:19 +00:00
}