mirror of
https://github.com/daeuniverse/dae.git
synced 2024-12-22 21:05:06 +07:00
fix(group): policy 'fixed' parsing (#149)
This commit is contained in:
parent
1546f30e4e
commit
d3dcfe6bb5
@ -37,12 +37,12 @@ func NewDialerSelectionPolicyFromGroupParam(param *config.Group) (policy *Dialer
|
||||
if f.Not {
|
||||
return nil, fmt.Errorf("policy param does not support not operator: !%v()", f.Name)
|
||||
}
|
||||
if len(f.Params) > 1 || f.Params[0].Key != "" {
|
||||
if len(f.Params) != 1 || f.Params[0].Key != "" {
|
||||
return nil, fmt.Errorf(`invalid "%v" param format`, f.Name)
|
||||
}
|
||||
strIndex := f.Params[0].Val
|
||||
index, err := strconv.Atoi(strIndex)
|
||||
if len(f.Params) > 1 || f.Params[0].Key != "" {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(`invalid "%v" param format: %w`, f.Name, err)
|
||||
}
|
||||
return &DialerSelectionPolicy{
|
||||
|
Loading…
Reference in New Issue
Block a user