• astaxie's avatar
    config: add more method · 2820f630
    astaxie authored
    DefaultString(key string, defaultval string) string      // support
    section::key type in key string when using ini and json type;
    Int,Int64,Bool,Float,DIY are same.
    	DefaultStrings(key string, defaultval []string) []string //get string
    slice
    	DefaultInt(key string, defaultval int) int
    	DefaultInt64(key string, defaultval int64) int64
    	DefaultBool(key string, defaultval bool) bool
    	DefaultFloat(key string, defaultval float64) float64
    	DIY(key string) (interface{}, error)
    	GetSection(section string) (map[string]string, error)
    	SaveConfigFile(filename string) error
    2820f630
config.go 2.68 KB