aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-08-14 01:30:17 +0000
committerTaras Madan <tarasmadan@google.com>2023-08-16 12:00:58 +0000
commit7773e940a7feacbe318f849807fe586fee985805 (patch)
tree8734362914e5b12696f6ce4c444f1c6ae1a44250 /vendor/github.com
parent39990d513277ce9372a4cc89bdac23d9fc30b056 (diff)
mod: do: bump github.com/golangci/golangci-lint from 1.54.0 to 1.54.1
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.54.0 to 1.54.1. - [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.54.0...v1.54.1) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go14
-rw-r--r--vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/custom_linters.go8
-rw-r--r--vendor/github.com/quasilyte/go-ruleguard/internal/goenv/goenv.go36
-rw-r--r--vendor/github.com/quasilyte/go-ruleguard/ruleguard/engine.go3
-rw-r--r--vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/gen_filter_op.go4
-rw-r--r--vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_loader.go4
-rw-r--r--vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/gen_opcodes.go4
-rw-r--r--vendor/github.com/quasilyte/go-ruleguard/ruleguard/runner.go4
8 files changed, 23 insertions, 54 deletions
diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go
index ffac384ed..1319c72d9 100644
--- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go
+++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go
@@ -283,20 +283,6 @@ func newGoCriticSettingsWrapper(settings *config.GoCriticSettings, logger loguti
allCheckerMap[checkInfo.Name] = checkInfo
}
- if settings != nil && config.IsGreaterThanOrEqualGo121(settings.Go) {
- var enabledChecks []string
- for _, check := range settings.EnabledChecks {
- if check == "ruleguard" {
- logger.Warnf("%s: check %q is disabled for go1.21 https://github.com/golangci/golangci-lint/issues/3933", goCriticName, "ruleguard")
- continue
- }
-
- enabledChecks = append(enabledChecks, check)
- }
-
- settings.EnabledChecks = enabledChecks
- }
-
return &goCriticSettingsWrapper{
GoCriticSettings: settings,
logger: logger,
diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/custom_linters.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/custom_linters.go
index bb1c61c05..d0eaa7905 100644
--- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/custom_linters.go
+++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/custom_linters.go
@@ -2,6 +2,7 @@ package lintersdb
import (
"fmt"
+ "os"
"path/filepath"
"plugin"
@@ -115,8 +116,11 @@ func (m *Manager) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyze
return nil, err
}
- m.log.Warnf("plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: " +
- "https://golangci-lint.run/contributing/new-linters/#create-a-plugin")
+ // TODO(ldez): remove this env var (but keep the log) in the next minor version (v1.55.0)
+ if _, ok := os.LookupEnv("GOLANGCI_LINT_HIDE_WARNING_ABOUT_PLUGIN_API_DEPRECATION"); !ok {
+ m.log.Warnf("plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: " +
+ "https://golangci-lint.run/contributing/new-linters/#create-a-plugin")
+ }
analyzerPlugin, ok := symbol.(AnalyzerPlugin)
if !ok {
diff --git a/vendor/github.com/quasilyte/go-ruleguard/internal/goenv/goenv.go b/vendor/github.com/quasilyte/go-ruleguard/internal/goenv/goenv.go
index 2f207aa07..52d0f5204 100644
--- a/vendor/github.com/quasilyte/go-ruleguard/internal/goenv/goenv.go
+++ b/vendor/github.com/quasilyte/go-ruleguard/internal/goenv/goenv.go
@@ -3,46 +3,26 @@ package goenv
import (
"errors"
"os/exec"
- "runtime"
- "strconv"
"strings"
)
func Read() (map[string]string, error) {
- out, err := exec.Command("go", "env").CombinedOutput()
+ // pass in a fixed set of var names to avoid needing to unescape output
+ // pass in literals here instead of a variable list to avoid security linter warnings about command injection
+ out, err := exec.Command("go", "env", "GOROOT", "GOPATH", "GOARCH", "GOOS", "CGO_ENABLED").CombinedOutput()
if err != nil {
return nil, err
}
- return parseGoEnv(out, runtime.GOOS)
+ return parseGoEnv([]string{"GOROOT", "GOPATH", "GOARCH", "GOOS", "CGO_ENABLED"}, out)
}
-func parseGoEnv(data []byte, goos string) (map[string]string, error) {
+func parseGoEnv(varNames []string, data []byte) (map[string]string, error) {
vars := make(map[string]string)
lines := strings.Split(strings.ReplaceAll(string(data), "\r\n", "\n"), "\n")
-
- if goos == "windows" {
- // Line format is: `set $name=$value`
- for _, l := range lines {
- l = strings.TrimPrefix(l, "set ")
- parts := strings.Split(l, "=")
- if len(parts) != 2 {
- continue
- }
- vars[parts[0]] = parts[1]
- }
- } else {
- // Line format is: `$name="$value"`
- for _, l := range lines {
- parts := strings.Split(strings.TrimSpace(l), "=")
- if len(parts) != 2 {
- continue
- }
- val, err := strconv.Unquote(parts[1])
- if err != nil {
- continue
- }
- vars[parts[0]] = val
+ for i, varName := range varNames {
+ if i < len(lines) && len(lines[i]) > 0 {
+ vars[varName] = lines[i]
}
}
diff --git a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/engine.go b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/engine.go
index 88feef92d..e4cf954ff 100644
--- a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/engine.go
+++ b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/engine.go
@@ -8,7 +8,6 @@ import (
"go/token"
"go/types"
"io"
- "io/ioutil"
"os"
"sort"
"strings"
@@ -48,7 +47,7 @@ func (e *engine) LoadedGroups() []GoRuleGroup {
}
func (e *engine) Load(ctx *LoadContext, buildContext *build.Context, filename string, r io.Reader) error {
- data, err := ioutil.ReadAll(r)
+ data, err := io.ReadAll(r)
if err != nil {
return err
}
diff --git a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/gen_filter_op.go b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/gen_filter_op.go
index aecb975d8..b1c819492 100644
--- a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/gen_filter_op.go
+++ b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/gen_filter_op.go
@@ -7,7 +7,7 @@ import (
"bytes"
"fmt"
"go/format"
- "io/ioutil"
+ "os"
"strings"
)
@@ -142,7 +142,7 @@ func main() {
panic(err)
}
- if err := ioutil.WriteFile("filter_op.gen.go", pretty, 0644); err != nil {
+ if err := os.WriteFile("filter_op.gen.go", pretty, 0644); err != nil {
panic(err)
}
}
diff --git a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_loader.go b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_loader.go
index d71668914..dcb2fd2af 100644
--- a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_loader.go
+++ b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_loader.go
@@ -8,7 +8,7 @@ import (
"go/parser"
"go/token"
"go/types"
- "io/ioutil"
+ "os"
"regexp"
"github.com/quasilyte/gogrep"
@@ -144,7 +144,7 @@ func (l *irLoader) loadBundle(bundle ir.BundleImport) error {
}
func (l *irLoader) loadExternFile(prefix, pkgPath, filename string) (*goRuleSet, error) {
- src, err := ioutil.ReadFile(filename)
+ src, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/gen_opcodes.go b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/gen_opcodes.go
index c8d512038..80386df28 100644
--- a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/gen_opcodes.go
+++ b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/gen_opcodes.go
@@ -7,8 +7,8 @@ import (
"bytes"
"fmt"
"go/format"
- "io/ioutil"
"log"
+ "os"
"strings"
"text/template"
)
@@ -186,7 +186,7 @@ func writeFile(filename string, data []byte) {
if err != nil {
log.Panicf("gofmt: %v", err)
}
- if err := ioutil.WriteFile(filename, pretty, 0666); err != nil {
+ if err := os.WriteFile(filename, pretty, 0666); err != nil {
log.Panicf("write %s: %v", filename, err)
}
}
diff --git a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/runner.go b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/runner.go
index c76b6db33..fdc95ab5e 100644
--- a/vendor/github.com/quasilyte/go-ruleguard/ruleguard/runner.go
+++ b/vendor/github.com/quasilyte/go-ruleguard/ruleguard/runner.go
@@ -8,7 +8,7 @@ import (
"go/build"
"go/printer"
"go/token"
- "io/ioutil"
+ "os"
"path/filepath"
"reflect"
"sort"
@@ -166,7 +166,7 @@ func (rr *rulesRunner) fileBytes() []byte {
}
// TODO(quasilyte): re-use src slice?
- src, err := ioutil.ReadFile(rr.filename)
+ src, err := os.ReadFile(rr.filename)
if err != nil || src == nil {
// Assign a zero-length slice so rr.src
// is never nil during the second fileBytes call.