aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/kisielk
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-03-04 17:40:11 +0000
committerTaras Madan <tarasmadan@google.com>2024-03-04 18:34:55 +0000
commit5fc5366972c874b919f93165bb4ed4e2bcb7c350 (patch)
tree287c3361a0dee0c72af80d9a1a66714a06e98a62 /vendor/github.com/kisielk
parent1be5ce38a9059c356eb193a8c34d60d61c9fc31f (diff)
mod: bump github.com/golangci/golangci-lint from 1.55.2 to 1.56.2
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.2 to 1.56.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.55.2...v1.56.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/kisielk')
-rw-r--r--vendor/github.com/kisielk/errcheck/errcheck/analyzer.go6
-rw-r--r--vendor/github.com/kisielk/errcheck/errcheck/errcheck.go6
-rw-r--r--vendor/github.com/kisielk/errcheck/errcheck/excludes.go80
3 files changed, 44 insertions, 48 deletions
diff --git a/vendor/github.com/kisielk/errcheck/errcheck/analyzer.go b/vendor/github.com/kisielk/errcheck/errcheck/analyzer.go
index 68593cc9a..82ab6298a 100644
--- a/vendor/github.com/kisielk/errcheck/errcheck/analyzer.go
+++ b/vendor/github.com/kisielk/errcheck/errcheck/analyzer.go
@@ -31,7 +31,6 @@ func init() {
}
func runAnalyzer(pass *analysis.Pass) (interface{}, error) {
-
exclude := map[string]bool{}
if !argExcludeOnly {
for _, name := range DefaultExcludedSymbols {
@@ -65,8 +64,9 @@ func runAnalyzer(pass *analysis.Pass) (interface{}, error) {
for _, err := range v.errors {
pass.Report(analysis.Diagnostic{
- Pos: pass.Fset.File(f.Pos()).Pos(err.Pos.Offset),
- Message: "unchecked error",
+ Pos: pass.Fset.File(f.Pos()).Pos(err.Pos.Offset),
+ Message: "unchecked error",
+ Category: "errcheck",
})
}
diff --git a/vendor/github.com/kisielk/errcheck/errcheck/errcheck.go b/vendor/github.com/kisielk/errcheck/errcheck/errcheck.go
index a5ee3711c..d61d348f7 100644
--- a/vendor/github.com/kisielk/errcheck/errcheck/errcheck.go
+++ b/vendor/github.com/kisielk/errcheck/errcheck/errcheck.go
@@ -167,7 +167,7 @@ func (c *Checker) LoadPackages(paths ...string) ([]*packages.Package, error) {
buildFlags = append(buildFlags, fmt.Sprintf("-mod=%s", c.Mod))
}
cfg := &packages.Config{
- Mode: packages.LoadAllSyntax,
+ Mode: packages.NeedSyntax | packages.NeedTypes | packages.NeedTypesInfo,
Tests: !c.Exclusions.TestFiles,
BuildFlags: buildFlags,
}
@@ -205,7 +205,7 @@ func (c *Checker) CheckPackage(pkg *packages.Package) Result {
ignore := map[string]*regexp.Regexp{}
// Apply SymbolRegexpsByPackage first so that if the same path appears in
- // Packages, a more narrow regexp will be superceded by dotStar below.
+ // Packages, a more narrow regexp will be superseded by dotStar below.
if regexps := c.Exclusions.SymbolRegexpsByPackage; regexps != nil {
for pkg, re := range regexps {
// TODO warn if previous entry overwritten?
@@ -337,7 +337,7 @@ func (v *visitor) selectorName(call *ast.CallExpr) string {
// names are returned. If the function is package-qualified (like "fmt.Printf()")
// then just that function's fullName is returned.
//
-// Otherwise, we walk through all the potentially embeddded interfaces of the receiver
+// Otherwise, we walk through all the potentially embedded interfaces of the receiver
// the collect a list of type-qualified function names that we will check.
func (v *visitor) namesForExcludeCheck(call *ast.CallExpr) []string {
sel, fn, ok := v.selectorAndFunc(call)
diff --git a/vendor/github.com/kisielk/errcheck/errcheck/excludes.go b/vendor/github.com/kisielk/errcheck/errcheck/excludes.go
index 22db9fe11..a783b5a76 100644
--- a/vendor/github.com/kisielk/errcheck/errcheck/excludes.go
+++ b/vendor/github.com/kisielk/errcheck/errcheck/excludes.go
@@ -3,64 +3,60 @@ package errcheck
import (
"bufio"
"bytes"
- "io/ioutil"
+ "os"
"strings"
)
-var (
- // DefaultExcludedSymbols is a list of symbol names that are usually excluded from checks by default.
- //
- // Note, that they still need to be explicitly copied to Checker.Exclusions.Symbols
- DefaultExcludedSymbols = []string{
- // bytes
- "(*bytes.Buffer).Write",
- "(*bytes.Buffer).WriteByte",
- "(*bytes.Buffer).WriteRune",
- "(*bytes.Buffer).WriteString",
+// DefaultExcludedSymbols is a list of symbol names that are usually excluded from checks by default.
+//
+// Note, that they still need to be explicitly copied to Checker.Exclusions.Symbols
+var DefaultExcludedSymbols = []string{
+ // bytes
+ "(*bytes.Buffer).Write",
+ "(*bytes.Buffer).WriteByte",
+ "(*bytes.Buffer).WriteRune",
+ "(*bytes.Buffer).WriteString",
- // fmt
- "fmt.Errorf",
- "fmt.Print",
- "fmt.Printf",
- "fmt.Println",
- "fmt.Fprint(*bytes.Buffer)",
- "fmt.Fprintf(*bytes.Buffer)",
- "fmt.Fprintln(*bytes.Buffer)",
- "fmt.Fprint(*strings.Builder)",
- "fmt.Fprintf(*strings.Builder)",
- "fmt.Fprintln(*strings.Builder)",
- "fmt.Fprint(os.Stderr)",
- "fmt.Fprintf(os.Stderr)",
- "fmt.Fprintln(os.Stderr)",
+ // fmt
+ "fmt.Print",
+ "fmt.Printf",
+ "fmt.Println",
+ "fmt.Fprint(*bytes.Buffer)",
+ "fmt.Fprintf(*bytes.Buffer)",
+ "fmt.Fprintln(*bytes.Buffer)",
+ "fmt.Fprint(*strings.Builder)",
+ "fmt.Fprintf(*strings.Builder)",
+ "fmt.Fprintln(*strings.Builder)",
+ "fmt.Fprint(os.Stderr)",
+ "fmt.Fprintf(os.Stderr)",
+ "fmt.Fprintln(os.Stderr)",
- // io
- "(*io.PipeReader).CloseWithError",
- "(*io.PipeWriter).CloseWithError",
+ // io
+ "(*io.PipeReader).CloseWithError",
+ "(*io.PipeWriter).CloseWithError",
- // math/rand
- "math/rand.Read",
- "(*math/rand.Rand).Read",
+ // math/rand
+ "math/rand.Read",
+ "(*math/rand.Rand).Read",
- // strings
- "(*strings.Builder).Write",
- "(*strings.Builder).WriteByte",
- "(*strings.Builder).WriteRune",
- "(*strings.Builder).WriteString",
+ // strings
+ "(*strings.Builder).Write",
+ "(*strings.Builder).WriteByte",
+ "(*strings.Builder).WriteRune",
+ "(*strings.Builder).WriteString",
- // hash
- "(hash.Hash).Write",
- }
-)
+ // hash
+ "(hash.Hash).Write",
+}
// ReadExcludes reads an excludes file, a newline delimited file that lists
// patterns for which to allow unchecked errors.
//
// Lines that start with two forward slashes are considered comments and are ignored.
-//
func ReadExcludes(path string) ([]string, error) {
var excludes []string
- buf, err := ioutil.ReadFile(path)
+ buf, err := os.ReadFile(path)
if err != nil {
return nil, err
}