fix: problem that cannot use unsorted ip set in dns response routing

This commit is contained in:
mzz2017
2023-03-31 23:36:24 +08:00
parent 6657fb329c
commit d9133b2517
3 changed files with 5 additions and 4 deletions

View File

@ -143,7 +143,7 @@ func ParamParser(to reflect.Value, section *config_parser.Section, ignoreType []
// Assign. "to" should have field "Rules".
structField, ok := to.Type().FieldByName("Rules")
if !ok || structField.Type != reflect.TypeOf([]*config_parser.RoutingRule{}) {
return fmt.Errorf("unexpected type: \"routing rule\": %v", itemVal.String(true, false, false))
return fmt.Errorf("cannot use routing rule in this context: %v", itemVal.String(true, false, false))
}
if structField.Tag.Get("mapstructure") != "_" {
return fmt.Errorf("a []*RoutingRule field \"Rules\" with mapstructure:\"_\" is required in struct %v to parse section", to.Type().String())