From 7b4377ad9d8a7205416df8d6217ef2b010f89481 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Wed, 22 Jan 2025 16:07:17 +0100 Subject: vendor: delete --- vendor/github.com/macabu/inamedparam/.gitignore | 22 ----- vendor/github.com/macabu/inamedparam/.golangci.yml | 33 -------- vendor/github.com/macabu/inamedparam/LICENSE-MIT | 21 ----- vendor/github.com/macabu/inamedparam/README.md | 38 --------- .../github.com/macabu/inamedparam/inamedparam.go | 94 ---------------------- 5 files changed, 208 deletions(-) delete mode 100644 vendor/github.com/macabu/inamedparam/.gitignore delete mode 100644 vendor/github.com/macabu/inamedparam/.golangci.yml delete mode 100644 vendor/github.com/macabu/inamedparam/LICENSE-MIT delete mode 100644 vendor/github.com/macabu/inamedparam/README.md delete mode 100644 vendor/github.com/macabu/inamedparam/inamedparam.go (limited to 'vendor/github.com/macabu') diff --git a/vendor/github.com/macabu/inamedparam/.gitignore b/vendor/github.com/macabu/inamedparam/.gitignore deleted file mode 100644 index f8d51e94c..000000000 --- a/vendor/github.com/macabu/inamedparam/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -inamedparam - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work diff --git a/vendor/github.com/macabu/inamedparam/.golangci.yml b/vendor/github.com/macabu/inamedparam/.golangci.yml deleted file mode 100644 index f0efa1cb6..000000000 --- a/vendor/github.com/macabu/inamedparam/.golangci.yml +++ /dev/null @@ -1,33 +0,0 @@ -run: - deadline: 30s - -linters: - enable-all: true - disable: - - cyclop - - deadcode - - depguard - - exhaustivestruct - - exhaustruct - - forcetypeassert - - gochecknoglobals - - gocognit - - golint - - ifshort - - interfacer - - maligned - - nilnil - - nosnakecase - - paralleltest - - scopelint - - structcheck - - varcheck - -linters-settings: - gci: - sections: - - standard - - default - - prefix(github.com/macabu/inamedparam) - section-separators: - - newLine diff --git a/vendor/github.com/macabu/inamedparam/LICENSE-MIT b/vendor/github.com/macabu/inamedparam/LICENSE-MIT deleted file mode 100644 index b95f480ee..000000000 --- a/vendor/github.com/macabu/inamedparam/LICENSE-MIT +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Matheus Macabu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/macabu/inamedparam/README.md b/vendor/github.com/macabu/inamedparam/README.md deleted file mode 100644 index 3336cb950..000000000 --- a/vendor/github.com/macabu/inamedparam/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# inamedparam - -A linter that reports interfaces with unnamed method parameters. - -## Flags/Config -```sh --skip-single-param - skip interfaces with a single unnamed parameter -``` - -## Usage - -### Standalone -You can run it standalone through `go vet`. - -You must install the binary to your `$GOBIN` folder like so: -```sh -$ go install github.com/macabu/inamedparam/cmd/inamedparam -``` - -And then navigate to your Go project's root folder, where can run `go vet` in the following way: -```sh -$ go vet -vettool=$(which inamedparam) ./... -``` - -### golangci-lint -`inamedparam` was added as a linter to `golangci-lint` on version `v1.55.0`. It is disabled by default. - -To enable it, you can add it to your `.golangci.yml` file, as such: -```yaml -run: - deadline: 30s - -linters: - disable-all: true - enable: - - inamedparam -``` diff --git a/vendor/github.com/macabu/inamedparam/inamedparam.go b/vendor/github.com/macabu/inamedparam/inamedparam.go deleted file mode 100644 index 8ba7fe188..000000000 --- a/vendor/github.com/macabu/inamedparam/inamedparam.go +++ /dev/null @@ -1,94 +0,0 @@ -package inamedparam - -import ( - "flag" - "go/ast" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const ( - analyzerName = "inamedparam" - - flagSkipSingleParam = "skip-single-param" -) - -var Analyzer = &analysis.Analyzer{ - Name: analyzerName, - Doc: "reports interfaces with unnamed method parameters", - Run: run, - Flags: flags(), - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, -} - -func flags() flag.FlagSet { - flags := flag.NewFlagSet(analyzerName, flag.ExitOnError) - - flags.Bool(flagSkipSingleParam, false, "skip interface methods with a single unnamed parameter") - - return *flags -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - types := []ast.Node{ - &ast.InterfaceType{}, - } - - skipSingleParam := pass.Analyzer.Flags.Lookup(flagSkipSingleParam).Value.(flag.Getter).Get().(bool) - - inspect.Preorder(types, func(n ast.Node) { - interfaceType, ok := n.(*ast.InterfaceType) - if !ok || interfaceType == nil || interfaceType.Methods == nil { - return - } - - for _, method := range interfaceType.Methods.List { - interfaceFunc, ok := method.Type.(*ast.FuncType) - if !ok || interfaceFunc == nil || interfaceFunc.Params == nil { - continue - } - - // Improvement: add test case to reproduce this. Help wanted. - if len(method.Names) == 0 { - continue - } - - methodName := method.Names[0].Name - - if skipSingleParam && len(interfaceFunc.Params.List) == 1 { - continue - } - - for _, param := range interfaceFunc.Params.List { - if param.Names == nil { - var builtParamType string - - switch paramType := param.Type.(type) { - case *ast.SelectorExpr: - if ident := paramType.X.(*ast.Ident); ident != nil { - builtParamType += ident.Name + "." - } - - builtParamType += paramType.Sel.Name - case *ast.Ident: - builtParamType = paramType.Name - } - - if builtParamType != "" { - pass.Reportf(param.Pos(), "interface method %v must have named param for type %v", methodName, builtParamType) - } else { - pass.Reportf(param.Pos(), "interface method %v must have all named params", methodName) - } - } - } - } - }) - - return nil, nil -} -- cgit mrf-deployment