From 8ee452f5449eb762442b5305d2955fc857e0d6e0 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sun, 12 Mar 2023 14:58:27 +0800 Subject: [PATCH] chore: format code --- constant/dns.go | 2 +- dns/middleware.go | 4 ++-- dns/util.go | 2 +- hub/hub.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/constant/dns.go b/constant/dns.go index da68753c..3d97d97b 100644 --- a/constant/dns.go +++ b/constant/dns.go @@ -124,4 +124,4 @@ const ( HTTPVersion2 HTTPVersion = "h2" // HTTPVersion3 is HTTP/3. HTTPVersion3 HTTPVersion = "h3" -) \ No newline at end of file +) diff --git a/dns/middleware.go b/dns/middleware.go index 0437419b..f2dd9c96 100644 --- a/dns/middleware.go +++ b/dns/middleware.go @@ -47,7 +47,7 @@ func withHosts(hosts R.Hosts, mapping *cache.LruCache[netip.Addr, string]) middl if err == nil { resp.Id = r.Id resp.Question = r.Question - handleCName(resp,record.Domain) + handleCName(resp, record.Domain) } return resp, err } @@ -84,7 +84,7 @@ func withHosts(hosts R.Hosts, mapping *cache.LruCache[netip.Addr, string]) middl case D.TypeAAAA: handleIPs() case D.TypeCNAME: - handleCName(r,record.Domain) + handleCName(r, record.Domain) default: return next(ctx, r) } diff --git a/dns/util.go b/dns/util.go index 99e28587..4821195d 100644 --- a/dns/util.go +++ b/dns/util.go @@ -66,7 +66,7 @@ func setMsgTTL(msg *D.Msg, ttl uint32) { } func isIPRequest(q D.Question) bool { - return q.Qclass == D.ClassINET && (q.Qtype == D.TypeA || q.Qtype == D.TypeAAAA||q.Qtype==D.TypeCNAME) + return q.Qclass == D.ClassINET && (q.Qtype == D.TypeA || q.Qtype == D.TypeAAAA || q.Qtype == D.TypeCNAME) } func transform(servers []NameServer, resolver *Resolver) []dnsClient { diff --git a/hub/hub.go b/hub/hub.go index e4c414fa..bd228fad 100644 --- a/hub/hub.go +++ b/hub/hub.go @@ -44,7 +44,7 @@ func Parse(options ...Option) error { if cfg.General.ExternalController != "" { go route.Start(cfg.General.ExternalController, cfg.General.ExternalControllerTLS, - cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey,cfg.General.LogLevel==log.DEBUG) + cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.General.LogLevel == log.DEBUG) } executor.ApplyConfig(cfg, true)