From a642af694adca34bf48d5a7e71460fbd851173c7 Mon Sep 17 00:00:00 2001 From: D4ryl00 Date: Fri, 29 Mar 2024 17:31:01 +0100 Subject: [PATCH] chore: update Golang version on the CI jobs and fix lint errors Signed-off-by: D4ryl00 --- .github/workflows/go.yml | 20 ++++++++++---------- .tool-versions | 2 +- entry/fetcher.go | 16 ++++++++-------- identityprovider/orbitdb.go | 2 +- io/jsonable/types.go | 2 +- io/pb/pb.go | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 74d55ce..d7df973 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,18 +14,18 @@ jobs: strategy: matrix: golang: - - '1.19.x' + - "1.21.x" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.golang }} + cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v3.3.0 + uses: golangci/golangci-lint-action@v4 with: - go-version: ${{ matrix.golang }} - version: v1.50.1 + version: v1.54 args: --timeout=10m # only-new-issues: true @@ -34,8 +34,8 @@ jobs: strategy: matrix: golang: - - '1.19' - - '1.20' + - "1.21" + - "1.22" env: OS: ubuntu-latest GOLANG: ${{ matrix.golang }} @@ -80,8 +80,8 @@ jobs: strategy: matrix: golang: - - '1.19' - - '1.20' + - "1.21" + - "1.22" env: OS: macos-latest GOLANG: ${{ matrix.golang }} diff --git a/.tool-versions b/.tool-versions index 29cb7e0..0b5404a 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ golang 1.21.8 -golangci-lint 1.50.1 +golangci-lint 1.54.2 diff --git a/entry/fetcher.go b/entry/fetcher.go index e25f356..d914c6d 100644 --- a/entry/fetcher.go +++ b/entry/fetcher.go @@ -21,7 +21,7 @@ const ( taskKindDone ) -func noopShouldExclude(hash cid.Cid) bool { +func noopShouldExclude(_ cid.Cid) bool { return false } @@ -117,11 +117,11 @@ func (f *Fetcher) processQueue(ctx context.Context, hashes []cid.Cid) []iface.IP // run process go func(hash cid.Cid) { - entry, err := f.fetchEntry(ctx, hash) - if err != nil { // nolint:staticcheck - // @FIXME(gfanton): log this - // fmt.Printf("unable to fetch entry: %s\n", err.Error()) - } + entry, _ := f.fetchEntry(ctx, hash) + // if err != nil { + // @FIXME(gfanton): log this + // fmt.Printf("unable to fetch entry: %s\n", err.Error()) + // } // free process slot f.processDone() @@ -186,7 +186,7 @@ func (f *Fetcher) processQueue(ctx context.Context, hashes []cid.Cid) []iface.IP return results } -func (f *Fetcher) updateClock(ctx context.Context, entry, lastEntry iface.IPFSLogEntry) { +func (f *Fetcher) updateClock(_ context.Context, entry, lastEntry iface.IPFSLogEntry) { f.muClock.Lock() ts := entry.GetClock().GetTime() @@ -222,7 +222,7 @@ func (f *Fetcher) exclude(hash cid.Cid) (yes bool) { return } -func (f *Fetcher) addNextEntry(ctx context.Context, queue processQueue, entry iface.IPFSLogEntry, results []iface.IPFSLogEntry) { +func (f *Fetcher) addNextEntry(_ context.Context, queue processQueue, entry iface.IPFSLogEntry, results []iface.IPFSLogEntry) { ts := entry.GetClock().GetTime() if f.length < 0 { diff --git a/identityprovider/orbitdb.go b/identityprovider/orbitdb.go index 2d2be6d..90e06bc 100644 --- a/identityprovider/orbitdb.go +++ b/identityprovider/orbitdb.go @@ -15,7 +15,7 @@ type OrbitDBIdentityProvider struct { } // VerifyIdentity checks an OrbitDB identity. -func (p *OrbitDBIdentityProvider) VerifyIdentity(identity *Identity) error { +func (p *OrbitDBIdentityProvider) VerifyIdentity(_ *Identity) error { return nil } diff --git a/io/jsonable/types.go b/io/jsonable/types.go index 55026ed..b442bd7 100644 --- a/io/jsonable/types.go +++ b/io/jsonable/types.go @@ -73,7 +73,7 @@ func (c *IdentitySignature) ToPlain() (*identityprovider.IdentitySignature, erro }, nil } -func (e *EntryV0) ToPlain(out iface.IPFSLogEntry, provider identityprovider.Interface, newClock func() iface.IPFSLogLamportClock) error { +func (e *EntryV0) ToPlain(out iface.IPFSLogEntry, _ identityprovider.Interface, newClock func() iface.IPFSLogLamportClock) error { c := cid.Undef if e.Hash != nil { diff --git a/io/pb/pb.go b/io/pb/pb.go index 35cf470..93d7b5a 100644 --- a/io/pb/pb.go +++ b/io/pb/pb.go @@ -20,7 +20,7 @@ type pb struct { refEntry iface.IPFSLogEntry } -func (p *pb) Write(ctx context.Context, ipfs coreiface.CoreAPI, obj interface{}, opts *iface.WriteOpts) (cid.Cid, error) { +func (p *pb) Write(ctx context.Context, ipfs coreiface.CoreAPI, obj interface{}, _ *iface.WriteOpts) (cid.Cid, error) { var err error payload := []byte(nil)