From 4deedbf1ce712e9106c090fa5f795ba85cd672ed Mon Sep 17 00:00:00 2001 From: maranqz Date: Sat, 9 Nov 2024 12:20:36 +0400 Subject: [PATCH] Upgrade go version --- .github/workflows/ci.yml | 4 ++-- .golangci.yml | 18 ++---------------- cmd/gofactory/main.go | 3 +-- go.mod | 2 +- go.sum | 1 + lint_test.go | 9 +++------ 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9214dd4..491b5b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,8 @@ on: branches: [ main ] env: - GO_VERSION: ^1.20 - GOLANGCI_LINT_VERSION: v1.54.0 + GO_VERSION: 1.23 + GOLANGCI_LINT_VERSION: v1.61.0 jobs: lint: diff --git a/.golangci.yml b/.golangci.yml index edfdfb9..be8846c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,31 +7,17 @@ linters-settings: ignore-names: - v - ok - gci: - local-prefixes: github.com/maranqz/gofactory linters: enable-all: true disable: - - maligned - - deadcode - - golint - - scopelint - - varcheck - - structcheck - - nosnakecase - - exhaustivestruct - - ifshort - exhaustruct - depguard - - interfacer - thelper -run: - skip-dirs: - - testdata - issues: + exclude-dirs: + - testdata exclude-rules: - path: lint_test linters: diff --git a/cmd/gofactory/main.go b/cmd/gofactory/main.go index 81bf9f3..7d2a107 100644 --- a/cmd/gofactory/main.go +++ b/cmd/gofactory/main.go @@ -1,9 +1,8 @@ package main import ( - "golang.org/x/tools/go/analysis/singlechecker" - "github.com/maranqz/gofactory" + "golang.org/x/tools/go/analysis/singlechecker" ) func main() { diff --git a/go.mod b/go.mod index 79676d6..330b017 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/maranqz/gofactory -go 1.20 +go 1.23 require ( github.com/gobwas/glob v0.2.3 diff --git a/go.sum b/go.sum index 17f955c..cfdff78 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,7 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= diff --git a/lint_test.go b/lint_test.go index 4631554..37b6cdb 100644 --- a/lint_test.go +++ b/lint_test.go @@ -4,10 +4,9 @@ import ( "path/filepath" "testing" + "github.com/maranqz/gofactory" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/analysis/analysistest" - - "github.com/maranqz/gofactory" ) func TestLinterSuite(t *testing.T) { @@ -24,13 +23,13 @@ func TestLinterSuite(t *testing.T) { "generic": {pkgs: []string{"generic/..."}}, "packageGlobs": { pkgs: []string{"packageGlobs/..."}, - prepare: func(t *testing.T, a *analysis.Analyzer) error { + prepare: func(_ *testing.T, a *analysis.Analyzer) error { return a.Flags.Set("packageGlobs", "factory/packageGlobs/blocked/**") }, }, "packageGlobsOnly": { pkgs: []string{"packageGlobsOnly/main/..."}, - prepare: func(t *testing.T, a *analysis.Analyzer) error { + prepare: func(_ *testing.T, a *analysis.Analyzer) error { if err := a.Flags.Set("packageGlobs", "factory/packageGlobsOnly/blocked/**"); err != nil { return err } @@ -40,8 +39,6 @@ func TestLinterSuite(t *testing.T) { }, } for name, tt := range tests { - tt := tt - t.Run(name, func(t *testing.T) { t.Parallel()