mirror of
https://github.com/astaxie/beego.git
synced 2025-06-13 23:40:40 +00:00
Upgrade toml version
This commit is contained in:
@ -186,10 +186,6 @@ func (c *BaseConfiger) Strings(key string) ([]string, error) {
|
||||
return strings.Split(res, ";"), nil
|
||||
}
|
||||
|
||||
func (c *BaseConfiger) Unmarshaler(prefix string, obj interface{}, opt ...DecodeOption) error {
|
||||
return errors.New("unsupported operation")
|
||||
}
|
||||
|
||||
func (c *BaseConfiger) Sub(key string) (Configer, error) {
|
||||
return nil, errors.New("unsupported operation")
|
||||
}
|
||||
|
@ -98,6 +98,10 @@ func (c *fakeConfigContainer) SaveConfigFile(filename string) error {
|
||||
return errors.New("not implement in the fakeConfigContainer")
|
||||
}
|
||||
|
||||
func (c *fakeConfigContainer) Unmarshaler(prefix string, obj interface{}, opt ...DecodeOption) error {
|
||||
return errors.New("unsupported operation")
|
||||
}
|
||||
|
||||
var _ Configer = new(fakeConfigContainer)
|
||||
|
||||
// NewFakeConfig return a fake Configer
|
||||
|
@ -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{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user