func (s KVS) parse(o interface{}) (interface{}, error) {
	switch o := o.(type) {
	case Obj:
		for _, kv := range s {
			k, v, err := setKV(kv)
			if err != nil {
				return nil, err
			}
			o[k] = v
		}
	case JSON:
		for _, kv := range s {
			k, v, err := setKV(kv)
			if err != nil {
				return nil, err
			}
			o[k.(string)] = v
		}
	}
	return o, nil
}
KVS is like [["k1[t1]", "v1[t2]"], ["k1[t3]", "v1[t4]"]]
package main
import (
	"errors"
	"fmt"
	"strconv"
	"strings"
)
var (
	ErrEmptyParam       = errors.New("param is empty string")
	ErrInvalidObjFormat = errors.New("obj string format is invalid")
	ErrUnsupportedType  = "unsupported field type: %v"
)
type (
	KV  [2]string
	KVS []KV
)
func setVal(t string, v string) (interface{}, error) {
	var ret interface{}
	switch t {
	case "int":
		i, err := strconv.Atoi(v)
		if err != nil {
			return nil, err
		}
		ret = i
	case "uint":
		u, err := strconv.ParseUint(v, 10, 64)
		if err != nil {
			return nil, err
		}
		ret = u
	case "float":
		f, err := strconv.ParseFloat(v, 64)
		if err != nil {
			return nil, err
		}
		ret = f
	case "bool":
		b, err := strconv.ParseBool(v)
		if err != nil {
			return nil, err
		}
		ret = b
	case "string":
		ret = v
	case "byte":
		ret = v[0]
	default:
		return nil, fmt.Errorf(ErrUnsupportedType, t)
	}
	return ret, nil
}