From 095b17da6208793903d0e51409569b3013804623 Mon Sep 17 00:00:00 2001 From: JimhHan <50871214+JimhHan@users.noreply.github.com> Date: Thu, 8 Apr 2021 19:19:53 +0800 Subject: [PATCH] Fix typo --- common/matcher/geoip/conf.go | 2 +- common/matcher/geoip/geoip_test.go | 4 ++-- infra/conf/dns.go | 2 +- infra/conf/router.go | 4 ++-- infra/conf/xray.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/matcher/geoip/conf.go b/common/matcher/geoip/conf.go index 5760409a..4a997148 100644 --- a/common/matcher/geoip/conf.go +++ b/common/matcher/geoip/conf.go @@ -92,7 +92,7 @@ func find(data, code []byte) []byte { } } -func ParaseIPList(ips []string) ([]*GeoIP, error) { +func ParseIPList(ips []string) ([]*GeoIP, error) { var geoipList []*GeoIP var customCidrs []*CIDR diff --git a/common/matcher/geoip/geoip_test.go b/common/matcher/geoip/geoip_test.go index 60295782..b2bee0c4 100644 --- a/common/matcher/geoip/geoip_test.go +++ b/common/matcher/geoip/geoip_test.go @@ -25,7 +25,7 @@ func init() { } } -func TestParaseIPList(t *testing.T) { +func TestParseIPList(t *testing.T) { t.Log(os.Getenv("xray.location.asset")) common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoiptestrouter.dat"), platform.GetAssetLocation("geoip.dat"))) @@ -40,7 +40,7 @@ func TestParaseIPList(t *testing.T) { "ext-ip:geoiptestrouter.dat:!ca", } - _, err := ParaseIPList(ips) + _, err := ParseIPList(ips) if err != nil { t.Fatalf("Failed to parse geoip list, got %s", err) } diff --git a/infra/conf/dns.go b/infra/conf/dns.go index 0cb3b766..0e685dc5 100644 --- a/infra/conf/dns.go +++ b/infra/conf/dns.go @@ -74,7 +74,7 @@ func (c *NameServerConfig) Build() (*dns.NameServer, error) { }) } - geoipList, err := geoip.ParaseIPList(c.ExpectIPs) + geoipList, err := geoip.ParseIPList(c.ExpectIPs) if err != nil { return nil, newError("invalid IP rule: ", c.ExpectIPs).Base(err) } diff --git a/infra/conf/router.go b/infra/conf/router.go index e905b672..8a59bddf 100644 --- a/infra/conf/router.go +++ b/infra/conf/router.go @@ -203,7 +203,7 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) { } if rawFieldRule.IP != nil { - geoipList, err := geoip.ParaseIPList(*rawFieldRule.IP) + geoipList, err := geoip.ParseIPList(*rawFieldRule.IP) if err != nil { return nil, err } @@ -219,7 +219,7 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) { } if rawFieldRule.SourceIP != nil { - geoipList, err := geoip.ParaseIPList(*rawFieldRule.SourceIP) + geoipList, err := geoip.ParseIPList(*rawFieldRule.SourceIP) if err != nil { return nil, err } diff --git a/infra/conf/xray.go b/infra/conf/xray.go index 1f89ebad..b8b1ba8a 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -101,7 +101,7 @@ func (c *SniffingConfig) Build() (*proxyman.SniffingConfig, error) { var exIP []*geoip.GeoIP if c.IPsExcluded != nil { - exip, err := geoip.ParaseIPList(*c.IPsExcluded) + exip, err := geoip.ParseIPList(*c.IPsExcluded) if err != nil { return nil, newError("failed to parse excluded ip").Base(err) }