type "TomlMap" to private (rename TomlMap -> tomlMap)

This commit is contained in:
kandayasu 2016-07-26 01:37:03 +09:00
parent dd7cc7a6d2
commit 812de9e250

View File

@ -13,7 +13,7 @@ import (
"github.com/urfave/cli" "github.com/urfave/cli"
) )
type TomlMap struct { type tomlMap struct {
Map map[interface{}]interface{} Map map[interface{}]interface{}
} }
@ -66,7 +66,7 @@ func unmarshalMap(i interface{}) (ret map[interface{}]interface{}, err error) {
return ret, nil return ret, nil
} }
func (self *TomlMap) UnmarshalTOML(i interface{}) error { func (self *tomlMap) UnmarshalTOML(i interface{}) error {
if tmp, err := unmarshalMap(i); err == nil { if tmp, err := unmarshalMap(i); err == nil {
self.Map = tmp self.Map = tmp
} else { } else {
@ -82,7 +82,7 @@ type tomlSourceContext struct {
// NewTomlSourceFromFile creates a new TOML InputSourceContext from a filepath. // NewTomlSourceFromFile creates a new TOML InputSourceContext from a filepath.
func NewTomlSourceFromFile(file string) (InputSourceContext, error) { func NewTomlSourceFromFile(file string) (InputSourceContext, error) {
tsc := &tomlSourceContext{FilePath: file} tsc := &tomlSourceContext{FilePath: file}
var results TomlMap = TomlMap{} var results tomlMap = tomlMap{}
if err := readCommandToml(tsc.FilePath, &results); err != nil { if err := readCommandToml(tsc.FilePath, &results); err != nil {
return nil, fmt.Errorf("Unable to load TOML file '%s': inner error: \n'%v'", tsc.FilePath, err.Error()) return nil, fmt.Errorf("Unable to load TOML file '%s': inner error: \n'%v'", tsc.FilePath, err.Error())
} }