diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 674d55dd6c58..fe582ea4421c 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -1924,48 +1924,48 @@ linters-settings: # this is set to true - the append call must append either a variable # assigned, called or used on the line above. strict-append: true - + # Allows assignments to be cuddled with variables used in calls on # line above and calls to be cuddled with assignments of variables # used in call on line above. allow-assign-and-call: true - + # Allows assignments to be cuddled with anything. allow-assign-and-anything: false - + # Allows cuddling to assignments even if they span over multiple lines. allow-multiline-assign: true - + # If the number of lines in a case block is equal to or lager than this # number, the case *must* end white a newline. force-case-trailing-whitespace: 0 - + # Allow blocks to end with comments. allow-trailing-comment: false - + # Allow multiple comments in the beginning of a block separated with newline. allow-separated-leading-comment: false - + # Allow multiple var/declaration statements to be cuddled. allow-cuddle-declarations: false - + # A list of call idents that everything can be cuddled with. # Defaults to calls looking like locks. allow-cuddle-with-calls: [ "Lock", "RLock" ] - + # AllowCuddleWithRHS is a list of right hand side variables that is allowed # to be cuddled with anything. Defaults to assignments or calls looking # like unlocks. allow-cuddle-with-rhs: [ "Unlock", "RUnlock" ] - + # Causes an error when an If statement that checks an error variable doesn't # cuddle with the assignment of that variable. force-err-cuddling: false - + # When force-err-cuddling is enabled this is a list of names # used for error variables to check for in the conditional. error-variable-names: [ "err" ] - + # Causes an error if a short declaration (:=) cuddles with anything other than # another short declaration. # This logic overrides force-err-cuddling among others. diff --git a/.goreleaser.yml b/.goreleaser.yml index 5b498d900682..bac31e16b444 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -73,6 +73,10 @@ changelog: - Merge pull request - Merge branch +source: + enabled: true + name_template: '{{ .ProjectName }}-{{ .Version }}-source' + brews: - tap: owner: golangci diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4508724a23e0..31dc61eced52 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at idenx@yandex.com. All +reported by contacting the project team at info@golangci.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/docs/package-lock.json b/docs/package-lock.json index 70ed65867fd7..5e528327ab4b 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -4166,9 +4166,9 @@ "integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==" }, "node_modules/@sideway/formula": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", - "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" }, "node_modules/@sideway/pinpoint": { "version": "2.0.0", @@ -26592,9 +26592,9 @@ } }, "@sideway/formula": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", - "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" }, "@sideway/pinpoint": { "version": "2.0.0", diff --git a/docs/src/docs/contributing/architecture.mdx b/docs/src/docs/contributing/architecture.mdx index eb372bab4b4b..5a48b3d3e340 100644 --- a/docs/src/docs/contributing/architecture.mdx +++ b/docs/src/docs/contributing/architecture.mdx @@ -126,7 +126,7 @@ func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*l ``` First, we find a load mode as union of load modes for all enabled linters. -We use [go/packages](https://godoc.org/golang.org/x/tools/go/packages) for packages loading and use it's enum `packages.Need*` for load modes. +We use [go/packages](https://pkg.go.dev/golang.org/x/tools/go/packages) for packages loading and use it's enum `packages.Need*` for load modes. Load mode sets which data does a linter needs for execution. A linter that works only with AST need minimum of information: only filenames and AST. There is no need for @@ -165,7 +165,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). WithAlternativeNames("vet", "vetshadow"). - WithURL("https://golang.org/cmd/vet/"), + WithURL("https://pkg.go.dev/cmd/vet"), linter.NewConfig(golinters.NewBodyclose()). WithLoadForGoAnalysis(). WithPresets(linter.PresetPerformance, linter.PresetBugs). @@ -208,10 +208,10 @@ Currently, all linters except `unused` can be merged into this meta linter. The `unused` isn't merged because it has high memory usage. Linters execution starts in `runAnalyzers`. It's the most complex part of the `golangci-lint`. -We use custom [go/analysis](https://godoc.org/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can +We use custom [go/analysis](https://pkg.go.dev/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can to reduce memory usage. Also, it sets all heavyweight data to `nil` as becomes unneeded to save memory. -We don't use existing [multichecker](https://godoc.org/golang.org/x/tools/go/analysis/multichecker) because +We don't use existing [multichecker](https://pkg.go.dev/golang.org/x/tools/go/analysis/multichecker) because it doesn't use caching and doesn't have some important performance optimizations. All found by linters issues are represented with `result.Issue` struct: diff --git a/docs/src/docs/contributing/workflow.mdx b/docs/src/docs/contributing/workflow.mdx index afe9623dcaae..a6e8531a6d66 100644 --- a/docs/src/docs/contributing/workflow.mdx +++ b/docs/src/docs/contributing/workflow.mdx @@ -9,12 +9,12 @@ conduct](https://github.com/golangci/golangci-lint/blob/master/CODE_OF_CONDUCT.m ## Setup your machine -`golangci-lint` is written in [Go](https://golang.org/). +`golangci-lint` is written in [Go](https://go.dev). Prerequisites: - `make` -- [Go](https://golang.org/doc/install) +- [Go](https://go.dev/doc/install) Fork and clone [golangci-lint](https://github.com/golangci/golangci-lint) repository. diff --git a/docs/src/docs/usage/configuration.mdx b/docs/src/docs/usage/configuration.mdx index dfdbd17c72a2..d3bdfd3e107e 100644 --- a/docs/src/docs/usage/configuration.mdx +++ b/docs/src/docs/usage/configuration.mdx @@ -48,6 +48,6 @@ the `go tool trace` command and visualization tool. ## Cache -GolangCI-Lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://golang.org/pkg/os/#UserCacheDir). +GolangCI-Lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://pkg.go.dev/os#UserCacheDir). You can override the default cache directory with the environment variable `GOLANGCI_LINT_CACHE`; the path must be absolute. diff --git a/docs/src/docs/usage/performance.mdx b/docs/src/docs/usage/performance.mdx index 06e6b5c73cbb..28b890349b8f 100644 --- a/docs/src/docs/usage/performance.mdx +++ b/docs/src/docs/usage/performance.mdx @@ -4,7 +4,7 @@ title: Performance ## Memory Usage -A trade-off between memory usage and execution time can be controlled by [`GOGC`](https://golang.org/pkg/runtime/#hdr-Environment_Variables) environment variable. +A trade-off between memory usage and execution time can be controlled by [`GOGC`](https://pkg.go.dev/runtime#hdr-Environment_Variables) environment variable. Less `GOGC` values trigger garbage collection more frequently and golangci-lint consumes less memory and more CPU. Below is the trade-off table for running on this repo: | `GOGC` | Peak Memory, GB | Execution Time, s | diff --git a/go.mod b/go.mod index 2bfffb5f1f0a..84e4478593de 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/OpenPeeDeeP/depguard v1.1.1 github.com/alexkohler/prealloc v1.0.0 github.com/alingse/asasalint v0.0.11 - github.com/ashanbrown/forbidigo v1.3.0 + github.com/ashanbrown/forbidigo v1.4.0 github.com/ashanbrown/makezero v1.1.1 github.com/bkielbasa/cyclop v1.2.0 github.com/blizzy78/varnamelen v0.8.0 @@ -52,7 +52,7 @@ require ( github.com/jingyugao/rowserrcheck v1.1.1 github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af github.com/julz/importas v0.1.0 - github.com/junk1tm/musttag v0.4.4 + github.com/junk1tm/musttag v0.4.5 github.com/kisielk/errcheck v1.6.3 github.com/kkHAIKE/contextcheck v1.1.3 github.com/kulti/thelper v0.6.3 @@ -76,7 +76,7 @@ require ( github.com/nishanths/predeclared v0.2.2 github.com/nunnatsa/ginkgolinter v0.8.1 github.com/pkg/errors v0.9.1 - github.com/polyfloyd/go-errorlint v1.0.6 + github.com/polyfloyd/go-errorlint v1.1.0 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/ryancurrah/gomodguard v1.3.0 github.com/ryanrolds/sqlclosecheck v0.4.0 @@ -110,9 +110,9 @@ require ( github.com/yagipy/maintidx v1.0.0 github.com/yeya24/promlinter v0.2.0 gitlab.com/bosi/decorder v0.2.3 - golang.org/x/tools v0.5.0 + golang.org/x/tools v0.6.0 gopkg.in/yaml.v3 v3.0.1 - honnef.co/go/tools v0.4.0 + honnef.co/go/tools v0.4.2 mvdan.cc/gofumpt v0.4.0 mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d @@ -180,9 +180,9 @@ require ( go.uber.org/zap v1.17.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect - golang.org/x/mod v0.7.0 // indirect + golang.org/x/mod v0.8.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.4.0 // indirect + golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.6.0 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 496e85a04a19..8bde49ab6f8c 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQ github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= -github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= +github.com/ashanbrown/forbidigo v1.4.0 h1:spdPbupaSqtWORq1Q4eHBoPBmHtwVyLKwaedbSLc5Sw= +github.com/ashanbrown/forbidigo v1.4.0/go.mod h1:IvgwB5Y4fzqSAj/WVXKWigoTkB0dzI2FBbpKWuh7ph8= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -309,8 +309,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/junk1tm/musttag v0.4.4 h1:VK4L7v7lvWAhKDDx0cUJgbb0UBNipYinv8pPeHJzH9Q= -github.com/junk1tm/musttag v0.4.4/go.mod h1:XkcL/9O6RmD88JBXb+I15nYRl9W4ExhgQeCBEhfMC8U= +github.com/junk1tm/musttag v0.4.5 h1:d+mpJ1vn6WFEVKHwkgJiIedis1u/EawKOuUTygAUtCo= +github.com/junk1tm/musttag v0.4.5/go.mod h1:XkcL/9O6RmD88JBXb+I15nYRl9W4ExhgQeCBEhfMC8U= github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= @@ -414,8 +414,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.0.6 h1:ZevdyEGxDoHAMQUVvdTT06hnYuKULe8TQkOmIYx6s1c= -github.com/polyfloyd/go-errorlint v1.0.6/go.mod h1:NcnNncnm8fVV7vfQWiI4HZrzWFzGp24C262IQutNcMs= +github.com/polyfloyd/go-errorlint v1.1.0 h1:VKoEFg5yxSgJ2yFPVhxW7oGz+f8/OVcuMeNvcPIi6Eg= +github.com/polyfloyd/go-errorlint v1.1.0/go.mod h1:Uss7Bc/izYG0leCMRx3WVlrpqWedSZk7V/FUQW6VJ6U= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -640,8 +640,9 @@ golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -683,8 +684,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -769,8 +770,9 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -811,7 +813,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -870,8 +871,9 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= -golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -995,8 +997,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.4.0 h1:lyXVV1c8wUBJRKqI8JgIpT8TW1VDagfYYaxbKa/HoL8= -honnef.co/go/tools v0.4.0/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= +honnef.co/go/tools v0.4.2 h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc= +honnef.co/go/tools v0.4.2/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= diff --git a/pkg/golinters/forbidigo.go b/pkg/golinters/forbidigo.go index a8c256b9ee5a..95fb47e47b89 100644 --- a/pkg/golinters/forbidigo.go +++ b/pkg/golinters/forbidigo.go @@ -64,7 +64,7 @@ func runForbidigo(pass *analysis.Pass, settings *config.ForbidigoSettings) ([]go var issues []goanalysis.Issue for _, file := range pass.Files { - hints, err := forbid.Run(pass.Fset, file) + hints, err := forbid.RunWithConfig(forbidigo.RunConfig{Fset: pass.Fset}, file) if err != nil { return nil, errors.Wrapf(err, "forbidigo linter failed on file %q", file.Name.String()) } diff --git a/pkg/golinters/govet.go b/pkg/golinters/govet.go index 75f9059229bd..afed08214e23 100644 --- a/pkg/golinters/govet.go +++ b/pkg/golinters/govet.go @@ -89,7 +89,7 @@ var ( unusedwrite.Analyzer, } - // https://github.com/golang/go/blob/879db69ce2de814bc3203c39b45617ba51cc5366/src/cmd/vet/main.go#L40-L68 + // https://github.com/golang/go/blob/9f834a559c9ed6cdf883e29b36e21e5f956df74f/src/cmd/vet/main.go#L46-L76 defaultAnalyzers = []*analysis.Analyzer{ asmdecl.Analyzer, assign.Analyzer, @@ -114,6 +114,7 @@ var ( structtag.Analyzer, testinggoroutine.Analyzer, tests.Analyzer, + timeformat.Analyzer, unmarshal.Analyzer, unreachable.Analyzer, unsafeptr.Analyzer, diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index 03f898cefe7c..6f406f7d26e3 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -497,7 +497,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.0.0"). WithPresets(linter.PresetFormatting). WithAutoFix(). - WithURL("https://golang.org/cmd/gofmt/"), + WithURL("https://pkg.go.dev/cmd/gofmt"), linter.NewConfig(golinters.NewGofumpt(gofumptCfg)). WithSince("v1.28.0"). @@ -514,7 +514,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.20.0"). WithPresets(linter.PresetFormatting, linter.PresetImport). WithAutoFix(). - WithURL("https://godoc.org/golang.org/x/tools/cmd/goimports"), + WithURL("https://pkg.go.dev/golang.org/x/tools/cmd/goimports"), linter.NewConfig(golinters.NewGolint(golintCfg)). WithSince("v1.0.0"). @@ -562,7 +562,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs, linter.PresetMetaLinter). WithAlternativeNames("vet", "vetshadow"). - WithURL("https://golang.org/cmd/vet/"), + WithURL("https://pkg.go.dev/cmd/vet"), linter.NewConfig(golinters.NewGrouper(grouperCfg)). WithSince("v1.44.0"). diff --git a/pkg/lint/runner.go b/pkg/lint/runner.go index fab82fdff780..b26f044c64fe 100644 --- a/pkg/lint/runner.go +++ b/pkg/lint/runner.go @@ -63,7 +63,7 @@ func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, es *lint var extra string if lc.Deprecation.Replacement != "" { - extra = fmt.Sprintf(" Replaced by %s.", lc.Deprecation.Replacement) + extra = fmt.Sprintf("Replaced by %s.", lc.Deprecation.Replacement) } log.Warnf("The linter '%s' is deprecated (since %s) due to: %s %s", name, lc.Deprecation.Since, lc.Deprecation.Message, extra) diff --git a/pkg/result/processors/autogenerated_exclude.go b/pkg/result/processors/autogenerated_exclude.go index bc6ba30e67ba..5e41fd6a94d3 100644 --- a/pkg/result/processors/autogenerated_exclude.go +++ b/pkg/result/processors/autogenerated_exclude.go @@ -70,7 +70,7 @@ func (p *AutogeneratedExclude) shouldPassIssue(i *result.Issue) (bool, error) { } // isGenerated reports whether the source file is generated code. -// Using a bit laxer rules than https://golang.org/s/generatedcode to +// Using a bit laxer rules than https://go.dev/s/generatedcode to // match more generated code. See #48 and #72. func isGeneratedFileByComment(doc string) bool { const (