Upgrade toml version

This commit is contained in:
Ming Deng
2020-10-14 00:24:22 +08:00
parent ccf873fa8b
commit 3fc21ae6ec
6 changed files with 20 additions and 5 deletions

View File

@@ -27,6 +27,8 @@ import (
"strconv"
"strings"
"sync"
"github.com/mitchellh/mapstructure"
)
var (
@@ -505,6 +507,13 @@ func (c *IniConfigContainer) getdata(key string) string {
return ""
}
func (c *IniConfigContainer) Unmarshaler(prefix string, obj interface{}, opt ...DecodeOption) error {
if len(prefix) > 0 {
return errors.New("unsupported prefix params")
}
return mapstructure.Decode(c.data, opt)
}
func init() {
Register("ini", &IniConfig{})
}