chore: update linter to v1.42.1

* chore: update linter to v1.42.1

* fix: linter issues
This commit is contained in:
Nicholas Wiersma
2021-09-20 10:18:14 +02:00
committed by GitHub
parent b591ba0e78
commit 7a54353c7b
8 changed files with 20 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ on:
env:
GO_VERSION: 1.17
GOLANGCI_LINT_VERSION: v1.41.1
GOLANGCI_LINT_VERSION: v1.42.1
jobs:

View File

@@ -75,6 +75,9 @@
[[issues.exclude-rules]]
path = "interp/interp.go"
text = "`out` can be `io.Writer`"
[[issues.exclude-rules]]
path = "interp/interp.go"
text = "`Panic` should conform to the `XxxError` format"
[[issues.exclude-rules]]
path = "interp/interp_eval_test.go"
linters = ["thelper"]

View File

@@ -1183,7 +1183,7 @@ func main() {
log.Fatal(err)
}
if err = ioutil.WriteFile("op.go", source, 0666); err != nil {
if err = ioutil.WriteFile("op.go", source, 0o666); err != nil {
log.Fatal(err)
}
}

View File

@@ -20,7 +20,7 @@ func TestInterpConsistencyBuild(t *testing.T) {
}
dir := filepath.Join("..", "_test", "tmp")
if _, err := os.Stat(dir); os.IsNotExist(err) {
if err := os.Mkdir(dir, 0700); err != nil {
if err := os.Mkdir(dir, 0o700); err != nil {
t.Fatal(err)
}
}

View File

@@ -60,7 +60,7 @@ func Test_pkgDir(t *testing.T) {
// Create project
project := filepath.Join(goPath, "src", "guthib.com", "foo", "root")
if err := os.MkdirAll(project, 0700); err != nil {
if err := os.MkdirAll(project, 0o700); err != nil {
t.Fatal(err)
}
@@ -81,7 +81,7 @@ func Test_pkgDir(t *testing.T) {
path: "guthib.com/foo/bar",
root: "",
setup: func() error {
return os.MkdirAll(filepath.Join(goPath, "src", "guthib.com", "foo", "bar"), 0700)
return os.MkdirAll(filepath.Join(goPath, "src", "guthib.com", "foo", "bar"), 0o700)
},
expected: expected{
dir: filepath.Join(goPath, "src", "guthib.com", "foo", "bar"),
@@ -93,7 +93,7 @@ func Test_pkgDir(t *testing.T) {
path: "guthib.com/foo/bar",
root: filepath.Join("guthib.com", "foo", "root"),
setup: func() error {
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bar"), 0700)
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bar"), 0o700)
},
expected: expected{
dir: filepath.Join(goPath, "src", "guthib.com", "foo", "root", "vendor", "guthib.com", "foo", "bar"),
@@ -105,7 +105,7 @@ func Test_pkgDir(t *testing.T) {
path: "guthib.com/foo/bar",
root: filepath.Join("guthib.com", "foo", "root"),
setup: func() error {
return os.MkdirAll(filepath.Join(goPath, "src", "guthib.com", "foo", "bar"), 0700)
return os.MkdirAll(filepath.Join(goPath, "src", "guthib.com", "foo", "bar"), 0o700)
},
expected: expected{
dir: filepath.Join(goPath, "src", "guthib.com", "foo", "bar"),
@@ -117,10 +117,10 @@ func Test_pkgDir(t *testing.T) {
path: "guthib.com/foo/bar",
root: filepath.Join("guthib.com", "foo", "root", "vendor", "guthib.com", "foo", "bir"),
setup: func() error {
if err := os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bar"), 0700); err != nil {
if err := os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bar"), 0o700); err != nil {
return err
}
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bir"), 0700)
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bir"), 0o700)
},
expected: expected{
dir: filepath.Join(goPath, "src", "guthib.com", "foo", "root", "vendor", "guthib.com", "foo", "bar"),
@@ -132,10 +132,10 @@ func Test_pkgDir(t *testing.T) {
path: "guthib.com/foo/bar",
root: filepath.Join("guthib.com", "foo", "root", "vendor", "guthib.com", "foo", "bir"),
setup: func() error {
if err := os.MkdirAll(filepath.Join(goPath, "src", "guthib.com", "foo", "bar"), 0700); err != nil {
if err := os.MkdirAll(filepath.Join(goPath, "src", "guthib.com", "foo", "bar"), 0o700); err != nil {
return err
}
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bir"), 0700)
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bir"), 0o700)
},
expected: expected{
dir: filepath.Join(goPath, "src", "guthib.com", "foo", "bar"),
@@ -149,10 +149,10 @@ func Test_pkgDir(t *testing.T) {
setup: func() error {
if err := os.MkdirAll(
filepath.Join(goPath, "src", "guthib.com", "foo", "root", "vendor", "guthib.com", "foo", "bir", "vendor", "guthib.com", "foo", "bur"),
0700); err != nil {
0o700); err != nil {
return err
}
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bar"), 0700)
return os.MkdirAll(filepath.Join(project, "vendor", "guthib.com", "foo", "bar"), 0o700)
},
expected: expected{
dir: filepath.Join(project, "vendor", "guthib.com", "foo", "bar"),
@@ -173,7 +173,7 @@ func Test_pkgDir(t *testing.T) {
if err := os.RemoveAll(goPath); err != nil {
t.Fatal(err)
}
if err := os.MkdirAll(goPath, 0700); err != nil {
if err := os.MkdirAll(goPath, 0o700); err != nil {
t.Fatal(err)
}

View File

@@ -1,3 +1,4 @@
//go:build go1.16
// +build go1.16
// Package stdlib provides wrappers of standard library packages to be imported natively in Yaegi.

View File

@@ -1,3 +1,4 @@
//go:build go1.16
// +build go1.16
// Package syscall provide wrapper of standard library syscall package for native import in Yaegi.

View File

@@ -1,3 +1,4 @@
//go:build go1.16
// +build go1.16
// Package unsafe provides wrapper of standard library unsafe package to be imported natively in Yaegi.