diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 37f8431..b80c649 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ^1.22 + go-version: ^1.23 - name: Cache go module uses: actions/cache@v3 with: diff --git a/.github/workflows/debug.yml b/.github/workflows/test.yml similarity index 67% rename from .github/workflows/debug.yml rename to .github/workflows/test.yml index 7ae30fa..3afe968 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Debug build +name: test on: push: @@ -16,7 +16,7 @@ on: jobs: build: - name: Linux Debug build + name: Linux runs-on: ubuntu-latest steps: - name: Checkout @@ -24,14 +24,14 @@ jobs: with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.22 + go-version: ^1.23 - name: Build run: | make test build_go120: - name: Linux Debug build (Go 1.20) + name: Linux (Go 1.20) runs-on: ubuntu-latest steps: - name: Checkout @@ -39,7 +39,7 @@ jobs: with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ~1.20 continue-on-error: true @@ -47,7 +47,7 @@ jobs: run: | make test build_go121: - name: Linux Debug build (Go 1.21) + name: Linux (Go 1.21) runs-on: ubuntu-latest steps: - name: Checkout @@ -55,15 +55,31 @@ jobs: with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ~1.21 continue-on-error: true - name: Build run: | make test - build__windows: - name: Windows Debug build + build_go122: + name: Linux (Go 1.22) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: ~1.22 + continue-on-error: true + - name: Build + run: | + make test + build_windows: + name: Windows runs-on: windows-latest steps: - name: Checkout @@ -71,15 +87,15 @@ jobs: with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.22 + go-version: ^1.23 continue-on-error: true - name: Build run: | make test build_darwin: - name: macOS Debug build + name: macOS runs-on: macos-latest steps: - name: Checkout @@ -87,9 +103,9 @@ jobs: with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.22 + go-version: ^1.23 continue-on-error: true - name: Build run: | diff --git a/.golangci.yml b/.golangci.yml index 4133a1d..eecfec3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,6 +5,8 @@ linters: - govet - gci - staticcheck + - paralleltest + - ineffassign linters-settings: gci: @@ -13,5 +15,6 @@ linters-settings: - standard - prefix(github.com/sagernet/) - default - staticcheck: - go: '1.20' + +run: + go: "1.23" \ No newline at end of file diff --git a/transport_test.go b/transport_test.go index 787f544..77e58fd 100644 --- a/transport_test.go +++ b/transport_test.go @@ -35,7 +35,9 @@ func TestTransports(t *testing.T) { client := dns.NewClient(dns.ClientOptions{ Logger: logger.NOP(), }) - addresses, err := client.Lookup(context.Background(), transport, "cloudflare.com", dns.DomainStrategyAsIS) + addresses, err := client.Lookup(context.Background(), transport, "cloudflare.com", dns.QueryOptions{ + Strategy: dns.DomainStrategyUseIPv4, + }) require.NoError(t, err) require.NotEmpty(t, addresses) })