style: refine var name

This commit is contained in:
秋のかえで 2021-04-11 12:45:16 +08:00
parent 708ce026ca
commit 598e15aed2
No known key found for this signature in database
GPG key ID: C687746B27587C0D

View file

@ -23,7 +23,7 @@ import (
type DNS struct { type DNS struct {
sync.Mutex sync.Mutex
tag string tag string
cs CacheStrategy cacheStrategy CacheStrategy
disableFallback bool disableFallback bool
ipOption *dns.IPOption ipOption *dns.IPOption
hosts *StaticHosts hosts *StaticHosts
@ -139,7 +139,7 @@ func New(ctx context.Context, config *Config) (*DNS, error) {
ctx: ctx, ctx: ctx,
domainMatcher: domainMatcher, domainMatcher: domainMatcher,
matcherInfos: matcherInfos, matcherInfos: matcherInfos,
cs: config.CacheStrategy, cacheStrategy: config.CacheStrategy,
disableFallback: config.DisableFallback, disableFallback: config.DisableFallback,
}, nil }, nil
} }
@ -231,7 +231,7 @@ func (s *DNS) lookupIPInternal(domain string, option *dns.IPOption) ([]net.IP, e
errs := []error{} errs := []error{}
ctx := session.ContextWithInbound(s.ctx, &session.Inbound{Tag: s.tag}) ctx := session.ContextWithInbound(s.ctx, &session.Inbound{Tag: s.tag})
for _, client := range s.sortClients(domain, option) { for _, client := range s.sortClients(domain, option) {
ips, err := client.QueryIP(ctx, domain, *option, s.cs) ips, err := client.QueryIP(ctx, domain, *option, s.cacheStrategy)
if len(ips) > 0 { if len(ips) > 0 {
return ips, nil return ips, nil
} }