dev: remove github.com/pkg/errors inside tests (#3642)
This commit is contained in:
parent
075691c4e9
commit
5b4f7c71e1
@ -75,7 +75,7 @@ run:
|
||||
|
||||
# output configuration options
|
||||
output:
|
||||
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
|
||||
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions|teamcity
|
||||
#
|
||||
# Multiple can be specified by separating them by comma, output can be provided
|
||||
# for each of them by separating format name and path by colon symbol.
|
||||
|
4
test/testdata/configs/importas.yml
vendored
4
test/testdata/configs/importas.yml
vendored
@ -5,5 +5,5 @@ linters-settings:
|
||||
alias: fff
|
||||
- pkg: os
|
||||
alias: std_os
|
||||
- pkg: github.com/pkg/errors
|
||||
alias: pkgerr
|
||||
- pkg: golang.org/x/tools/go/analysis
|
||||
alias: ananas
|
||||
|
4
test/testdata/configs/importas_strict.yml
vendored
4
test/testdata/configs/importas_strict.yml
vendored
@ -6,5 +6,5 @@ linters-settings:
|
||||
alias: fff
|
||||
- pkg: os
|
||||
alias: std_os
|
||||
- pkg: github.com/pkg/errors
|
||||
alias: pkgerr
|
||||
- pkg: golang.org/x/tools/go/analysis
|
||||
alias: ananas
|
||||
|
4
test/testdata/fix/in/gci.go
vendored
4
test/testdata/fix/in/gci.go
vendored
@ -5,12 +5,12 @@ package gci
|
||||
|
||||
import (
|
||||
"github.com/golangci/golangci-lint/pkg/config"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/tools/go/analysis"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func GoimportsLocalTest() {
|
||||
fmt.Print("x")
|
||||
_ = config.Config{}
|
||||
_ = errors.New("")
|
||||
_ = analysis.Analyzer{}
|
||||
}
|
||||
|
4
test/testdata/fix/out/gci.go
vendored
4
test/testdata/fix/out/gci.go
vendored
@ -6,7 +6,7 @@ package gci
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/tools/go/analysis"
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/config"
|
||||
)
|
||||
@ -14,5 +14,5 @@ import (
|
||||
func GoimportsLocalTest() {
|
||||
fmt.Print("x")
|
||||
_ = config.Config{}
|
||||
_ = errors.New("")
|
||||
_ = analysis.Analyzer{}
|
||||
}
|
||||
|
4
test/testdata/gci.go
vendored
4
test/testdata/gci.go
vendored
@ -7,11 +7,11 @@ import (
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/config" // want "File is not \\`gci\\`-ed with --skip-generated -s standard,prefix\\(github.com/golangci/golangci-lint\\),default"
|
||||
|
||||
"github.com/pkg/errors" // want "File is not \\`gci\\`-ed with --skip-generated -s standard,prefix\\(github.com/golangci/golangci-lint\\),default"
|
||||
"golang.org/x/tools/go/analysis" // want "File is not \\`gci\\`-ed with --skip-generated -s standard,prefix\\(github.com/golangci/golangci-lint\\),default"
|
||||
)
|
||||
|
||||
func GoimportsLocalTest() {
|
||||
fmt.Print("x")
|
||||
_ = config.Config{}
|
||||
_ = errors.New("")
|
||||
_ = analysis.Analyzer{}
|
||||
}
|
||||
|
4
test/testdata/goimports_local.go
vendored
4
test/testdata/goimports_local.go
vendored
@ -6,11 +6,11 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/config" // want "File is not `goimports`-ed with -local github.com/golangci/golangci-lint"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/tools/go/analysis"
|
||||
)
|
||||
|
||||
func GoimportsLocalPrefixTest() {
|
||||
fmt.Print("x")
|
||||
_ = config.Config{}
|
||||
_ = errors.New("")
|
||||
_ = analysis.Analyzer{}
|
||||
}
|
||||
|
4
test/testdata/importas.go
vendored
4
test/testdata/importas.go
vendored
@ -7,12 +7,12 @@ import (
|
||||
"os"
|
||||
wrong_alias_again "os" // want `import "os" imported as "wrong_alias_again" but must be "std_os" according to config`
|
||||
|
||||
wrong "github.com/pkg/errors" // want `import "github.com/pkg/errors" imported as "wrong" but must be "pkgerr" according to config`
|
||||
wrong "golang.org/x/tools/go/analysis" // want `import "golang.org/x/tools/go/analysis" imported as "wrong" but must be "ananas" according to config`
|
||||
)
|
||||
|
||||
func ImportAsWrongAlias() {
|
||||
wrong_alias.Println("foo")
|
||||
wrong_alias_again.Stdout.WriteString("bar")
|
||||
os.Stdout.WriteString("test")
|
||||
_ = wrong.New("baz")
|
||||
_ = wrong.Analyzer{}
|
||||
}
|
||||
|
4
test/testdata/importas_strict.go
vendored
4
test/testdata/importas_strict.go
vendored
@ -7,12 +7,12 @@ import (
|
||||
"os" // want `import "os" imported without alias but must be with alias "std_os" according to config`
|
||||
wrong_alias_again "os" // want `import "os" imported as "wrong_alias_again" but must be "std_os" according to config`
|
||||
|
||||
wrong "github.com/pkg/errors" // want `import "github.com/pkg/errors" imported as "wrong" but must be "pkgerr" according to config`
|
||||
wrong "golang.org/x/tools/go/analysis" // want `import "golang.org/x/tools/go/analysis" imported as "wrong" but must be "ananas" according to config`
|
||||
)
|
||||
|
||||
func ImportAsStrictWrongAlias() {
|
||||
wrong_alias.Println("foo")
|
||||
wrong_alias_again.Stdout.WriteString("bar")
|
||||
os.Stdout.WriteString("test")
|
||||
_ = wrong.New("baz")
|
||||
_ = wrong.Analyzer{}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user