Skip to content

Commit 490f39e

Browse files
committed
improve typo
1 parent 635d166 commit 490f39e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

app/router/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (r *Rule) Apply(ctx routing.Context) bool {
3232
return r.Condition.Apply(ctx)
3333
}
3434

35-
func (rr *RoutingRule) BuildCondition(cachedDMPath string) (Condition, error) {
35+
func (rr *RoutingRule) BuildCondition(domainMatcherPath string) (Condition, error) {
3636
conds := NewConditionChan()
3737

3838
if len(rr.InboundTag) > 0 {
@@ -111,16 +111,16 @@ func (rr *RoutingRule) BuildCondition(cachedDMPath string) (Condition, error) {
111111
var err error
112112

113113
domains := rr.Domain
114-
if runtime.GOOS != "windows" && runtime.GOOS != "wasm" && cachedDMPath == "" {
114+
if runtime.GOOS != "windows" && runtime.GOOS != "wasm" && domainMatcherPath == "" {
115115
var err error
116116
domains, err = GetDomainList(rr.Domain)
117117
if err != nil {
118118
return nil, errors.New("failed to build domains from mmap").Base(err)
119119
}
120120
}
121121

122-
if cachedDMPath != "" {
123-
matcher, err = GetDomainMathcerWithRuleTag(cachedDMPath, rr.RuleTag)
122+
if domainMatcherPath != "" {
123+
matcher, err = GetDomainMathcerWithRuleTag(domainMatcherPath, rr.RuleTag)
124124
if err != nil {
125125
return nil, errors.New("failed to build domain condition from cached MphDomainMatcher").Base(err)
126126
}
@@ -273,14 +273,14 @@ func GetDomainList(domains []*Domain) ([]*Domain, error) {
273273
return domainList, nil
274274
}
275275

276-
func GetDomainMathcerWithRuleTag(cachedDMPath string, ruleTag string) (*DomainMatcher, error) {
277-
bs, err := filesystem.ReadFile(cachedDMPath)
276+
func GetDomainMathcerWithRuleTag(domainMatcherPath string, ruleTag string) (*DomainMatcher, error) {
277+
bs, err := filesystem.ReadFile(domainMatcherPath)
278278
if err != nil {
279-
return nil, errors.New("failed to load file: ", cachedDMPath).Base(err)
279+
return nil, errors.New("failed to load file: ", domainMatcherPath).Base(err)
280280
}
281281
g, err := LoadGeoSiteMatcher(bs, ruleTag)
282282
if err != nil {
283-
return nil, errors.New("failed to load file:", cachedDMPath).Base(err)
283+
return nil, errors.New("failed to load file:", domainMatcherPath).Base(err)
284284
}
285285
return &DomainMatcher{
286286
Matchers: g,

0 commit comments

Comments
 (0)