diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a00cdf5..4326e3f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v1 - name: Install yamllint @@ -18,14 +18,14 @@ jobs: name: shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: shellcheck - uses: azohra/shell-linter@v0.2.0 + uses: fkautz/shell-linter@v0.2.0 build: name: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v1 with: go-version: 1.13.4 @@ -35,7 +35,7 @@ jobs: name: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v1 with: go-version: 1.13.4 @@ -53,7 +53,7 @@ jobs: GOLANGCI_LINT_CONTAINER: golangci/golangci-lint:v1.23.2 steps: - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Pull golangci-lint docker container run: docker pull ${GOLANGCI_LINT_CONTAINER} - name: Run golangci-lint @@ -65,7 +65,7 @@ jobs: TAG: test ORG: networkservicemesh steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v1 with: go-version: 1.13.4 @@ -82,7 +82,7 @@ jobs: name: exclude fmt.Errorf runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Exclude fmt.Errorf run: | if grep -r --include=*.go fmt.Errorf . ; then @@ -94,7 +94,7 @@ jobs: name: Restrict dependencies on github.com/networkservicemesh/* runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Restrict dependencies on github.com/networkservicemesh/* run: | for i in $(grep github.com/networkservicemesh/ go.mod |grep -v '^module' | sed 's;.*\(github.com\/networkservicemesh\/[a-zA-z\/]*\).*;\1;g' | sort -u);do @@ -108,7 +108,7 @@ jobs: name: check go.mod and go.sum runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v1 with: go-version: 1.13.4 @@ -121,7 +121,7 @@ jobs: name: license header check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v1 with: go-version: 1.13.4 @@ -136,7 +136,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Exclude replace in go.mod run: | grep ^replace go.mod || exit 0 diff --git a/domain_test.go b/domain_test.go index 8f70a8a..19c1bd7 100644 --- a/domain_test.go +++ b/domain_test.go @@ -67,7 +67,7 @@ func TestDomain_ContainsShouldWorkFast(t *testing.T) { for i := 0; i < 10000; i++ { require.True(t, d.Contains(samples[i])) } - require.True(t, time.Since(start) < time.Second/5) + require.True(t, time.Since(start) < time.Second/4) } func TestDomainFewEntries(t *testing.T) { diff --git a/go.sum b/go.sum index 05b995a..18fdd7a 100644 --- a/go.sum +++ b/go.sum @@ -394,6 +394,7 @@ golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7 golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/setup.go b/setup.go index c912f63..0a073f2 100644 --- a/setup.go +++ b/setup.go @@ -249,7 +249,7 @@ func parseProtocol(f *Fanout, c *caddyfile.Dispenser) error { return c.ArgErr() } net := strings.ToLower(c.Val()) - if net != tcp && net != "udp" && net != tcptlc { + if net != tcp && net != udp && net != tcptlc { return errors.New("unknown network protocol") } f.net = net diff --git a/transport.go b/transport.go index b00837d..3fb808a 100644 --- a/transport.go +++ b/transport.go @@ -53,13 +53,12 @@ func (t *transportImpl) Dial(ctx context.Context, network string) (*dns.Conn, er network = tcptlc } if network == tcptlc { - t.dial(ctx, dns.Client{Net: network, Dialer: &net.Dialer{Timeout: maxTimeout}, TLSConfig: t.tlsConfig}) - + return t.dial(ctx, &dns.Client{Net: network, Dialer: &net.Dialer{Timeout: maxTimeout}, TLSConfig: t.tlsConfig}) } - return t.dial(ctx, dns.Client{Net: network, Dialer: &net.Dialer{Timeout: maxTimeout}}) + return t.dial(ctx, &dns.Client{Net: network, Dialer: &net.Dialer{Timeout: maxTimeout}}) } -func (t *transportImpl) dial(ctx context.Context, c dns.Client) (*dns.Conn, error) { +func (t *transportImpl) dial(ctx context.Context, c *dns.Client) (*dns.Conn, error) { var d net.Dialer if c.Dialer == nil { d = net.Dialer{Timeout: maxTimeout}