fix issue in gyaml for invalid decoding result of type map[interface{}]interface{}

This commit is contained in:
John
2019-09-17 20:53:20 +08:00
parent 4847fecdaa
commit c2ad9f5fb9
5 changed files with 133 additions and 22 deletions

View File

@ -12,7 +12,7 @@ import (
"github.com/gogf/gf/util/gconv"
yaml3 "gopkg.in/yaml.v3"
yaml3 "github.com/gf-third/yaml/v3"
)
func Encode(v interface{}) ([]byte, error) {
@ -24,7 +24,7 @@ func Decode(v []byte) (interface{}, error) {
if err := yaml3.Unmarshal(v, &result); err != nil {
return nil, err
}
return gconv.Map(result), nil
return gconv.MapDeep(result), nil
}
func DecodeTo(v []byte, result interface{}) error {