in config/monkey.go [316:337]
func (m *Monkey) getStringSlice(key string) ([]string, error) {
// This could be encoded natively as a list of strings, or as a string that
// represents a list of strings, so we need to handle both cases
t := m.v.Get(key)
if t == nil {
return nil, fmt.Errorf("%s not specified", param.Accounts)
}
switch t := t.(type) {
default:
return nil, fmt.Errorf("%s: unexpected type %T", param.Accounts, t)
case []string: // When set explicitly in code
return t, nil
case []interface{}: // When reading from config file
return toStrings(t)
case string: // When reading from prana, which uses string encoding
// Convert to list of strings
var result []string
err := json.Unmarshal([]byte(t), &result)
return result, err
}
}