mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 06:30:18 +00:00
Fixed #1735 Return empty []string
Need return empty []string if config value is empty. split `“”` ==> []string{}, Not []string{“”}
This commit is contained in:
@ -270,7 +270,11 @@ func (c *IniConfigContainer) DefaultString(key string, defaultval string) string
|
||||
|
||||
// Strings returns the []string value for a given key.
|
||||
func (c *IniConfigContainer) Strings(key string) []string {
|
||||
return strings.Split(c.String(key), ";")
|
||||
v := c.String(key)
|
||||
if v == "" {
|
||||
return []string{}
|
||||
}
|
||||
return strings.Split(v, ";")
|
||||
}
|
||||
|
||||
// DefaultStrings returns the []string value for a given key.
|
||||
|
Reference in New Issue
Block a user