diff --git a/.golangci.yaml b/.golangci.yaml index 747aaf5..22e317d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -7,6 +7,7 @@ linters: - depguard - gochecknoglobals - exhaustruct + - exhaustruct_v5 - err113 - gochecknoinits - ireturn diff --git a/Makefile b/Makefile index 8748f19..99e86b3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=golangci/golangci-lint -GOLANGCI_VERSION ?= v2.12.2 +GOLANGCI_VERSION ?= v2.13.1 TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools) GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION) diff --git a/cmd/gogit/cat-file.go b/cmd/gogit/cat-file.go index 6b4e717..e1fda60 100644 --- a/cmd/gogit/cat-file.go +++ b/cmd/gogit/cat-file.go @@ -69,7 +69,7 @@ var catFileCmd = &cobra.Command{ // catFileExistsCheck never returns: it calls os.Exit(1) when the object is // absent and os.Exit(0) when it is present. The signature returns error only // to fit cobra's RunE contract via its caller. -func catFileExistsCheck(r *git.Repository, oid string) error { //nolint:unparam +func catFileExistsCheck(r *git.Repository, oid string) error { h := plumbing.NewHash(oid) if _, err := r.Storer.EncodedObject(plumbing.AnyObject, h); err != nil { os.Exit(1) @@ -122,7 +122,7 @@ func catFileBatchCheckRun(cmd *cobra.Command, r *git.Repository, stdin io.Reader continue } - oid := strings.SplitN(raw, " ", 2)[0] + oid, _, _ := strings.Cut(raw, " ") h := plumbing.NewHash(oid) diff --git a/internal/plumbing/object/mktree_test.go b/internal/plumbing/object/mktree_test.go index 5538fce..9b36fc3 100644 --- a/internal/plumbing/object/mktree_test.go +++ b/internal/plumbing/object/mktree_test.go @@ -71,7 +71,7 @@ func TestWriteTreeRawAcceptsNullHash(t *testing.T) { t.Parallel() store := memory.NewStorage() - _ = (storer.EncodedObjectStorer)(store) // type assertion check + _ = storer.EncodedObjectStorer(store) // type assertion check obj := store.NewEncodedObject() obj.SetType(plumbing.TreeObject)