From df39908d210ca1ec7d2d538f814c0627b6817e41 Mon Sep 17 00:00:00 2001 From: Alexei Shevchenko Date: Sun, 11 Feb 2024 21:27:18 +0300 Subject: [PATCH] dependencies update + go1.22 (#86) --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/release.yml | 4 ++-- go.mod | 6 +++--- go.sum | 8 ++++---- internal/crawler/crawler_test.go | 2 ++ internal/crawler/util_test.go | 1 + internal/links/css.go | 2 +- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f67ad4..f0d384b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: - name: checkout uses: actions/checkout@v4 - name: setup golang - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.21 + go-version: ^1.22 - name: golangci-lint uses: golangci/golangci-lint-action@v3 - name: goreleaser-check @@ -36,14 +36,14 @@ jobs: - name: checkout uses: actions/checkout@v4 - name: setup golang - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.21 + go-version: ^1.22 - name: tests-only if: ${{ github.event_name == 'pull_request' }} run: make test - name: test-coverage - if: ${{ github.event_name == 'push' }} + if: ${{ false && github.event_name == 'push' }} uses: paambaati/codeclimate-action@v5.0.0 env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} @@ -61,9 +61,9 @@ jobs: - name: checkout uses: actions/checkout@v4 - name: setup golang - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.21 + go-version: ^1.22 - name: init codeql uses: github/codeql-action/init@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8dabb2a..c799865 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,9 @@ jobs: - name: checkout uses: actions/checkout@v4 - name: set up golang - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ^1.21 + go-version: ^1.22 - name: build uses: goreleaser/goreleaser-action@v5 with: diff --git a/go.mod b/go.mod index 4e27edd..9df7c9a 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/s0rg/crawley -go 1.21 +go 1.22 require ( github.com/s0rg/compflag v1.1.0 github.com/s0rg/set v1.2.0 - github.com/tdewolff/parse/v2 v2.7.10 - golang.org/x/net v0.20.0 + github.com/tdewolff/parse/v2 v2.7.11 + golang.org/x/net v0.21.0 ) diff --git a/go.sum b/go.sum index 61f8956..e9fff34 100644 --- a/go.sum +++ b/go.sum @@ -2,9 +2,9 @@ github.com/s0rg/compflag v1.1.0 h1:xhCUPLy+5Ue/Q9I/nIcLti2Ul6P42JYx4UvtYoDXmlQ= github.com/s0rg/compflag v1.1.0/go.mod h1:XMntVpc3+jpmBe0s8xo4w9swH8T9ARGkMC9HFiDRoUw= github.com/s0rg/set v1.2.0 h1:53b207YMktNQJXYei/oHuTR5oOO2e9+eieZOncYsh9g= github.com/s0rg/set v1.2.0/go.mod h1:xz3nDbjF4nyMLvAHvmE7rigXpNrKKTsi6iANznIB1/4= -github.com/tdewolff/parse/v2 v2.7.10 h1:itheTX7WBPxGI1eo+8HQ6QVGH+ubr3Lpv98YJVtqqRo= -github.com/tdewolff/parse/v2 v2.7.10/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= +github.com/tdewolff/parse/v2 v2.7.11 h1:v+W45LnzmjndVlfqPCT5gGjAAZKd1GJGOPJveTIkBY8= +github.com/tdewolff/parse/v2 v2.7.11/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52 h1:gAQliwn+zJrkjAHVcBEYW/RFvd2St4yYimisvozAYlA= github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= diff --git a/internal/crawler/crawler_test.go b/internal/crawler/crawler_test.go index c253ed8..ffad4a5 100644 --- a/internal/crawler/crawler_test.go +++ b/internal/crawler/crawler_test.go @@ -72,12 +72,14 @@ func TestCrawlerOK(t *testing.T) { switch r.Method { case http.MethodHead: gotHEAD = true + w.Header().Add(contentType, contentHTML) case http.MethodGet: if gotHEAD { gotGET = true } + _, _ = io.WriteString(w, body) } })) diff --git a/internal/crawler/util_test.go b/internal/crawler/util_test.go index 8dd620d..c2ff95a 100644 --- a/internal/crawler/util_test.go +++ b/internal/crawler/util_test.go @@ -94,6 +94,7 @@ func TestRelativeDepth(t *testing.T) { if gotDepht != tc.wantDepht { t.Errorf("pathDepth() gotDepht = %v, want %v", gotDepht, tc.wantDepht) } + if gotFound != tc.wantFound { t.Errorf("pathDepth() gotFound = %v, want %v", gotFound, tc.wantFound) } diff --git a/internal/links/css.go b/internal/links/css.go index a6940df..a354e1f 100644 --- a/internal/links/css.go +++ b/internal/links/css.go @@ -35,5 +35,5 @@ func extractCSSURL(v []byte) (rv string, ok bool) { rv = string(bytes.Trim(v[o+1:c], codeCleanChars)) - return rv, len(rv) > 0 + return rv, rv != "" }