lint by golangci-lint (#3080)

This commit is contained in:
fatedier
2022-08-29 01:02:53 +08:00
committed by GitHub
parent f4e4fbea62
commit 9d077b02cf
122 changed files with 947 additions and 1331 deletions

View File

@@ -9,12 +9,12 @@ import (
"strings"
"text/template"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/config"
"github.com/fatedier/frp/test/e2e/mock/server"
"github.com/fatedier/frp/test/e2e/pkg/port"
"github.com/fatedier/frp/test/e2e/pkg/process"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/config"
)
type Options struct {
@@ -102,7 +102,8 @@ func (f *Framework) BeforeEach() {
for k, v := range params {
switch t := v.(type) {
case int:
f.usedPorts[k] = int(t)
f.usedPorts[k] = t
default:
}
}
}
@@ -116,14 +117,14 @@ func (f *Framework) AfterEach() {
// stop processor
for _, p := range f.serverProcesses {
p.Stop()
_ = p.Stop()
if TestContext.Debug {
fmt.Println(p.ErrorOutput())
fmt.Println(p.StdOutput())
}
}
for _, p := range f.clientProcesses {
p.Stop()
_ = p.Stop()
if TestContext.Debug {
fmt.Println(p.ErrorOutput())
fmt.Println(p.StdOutput())
@@ -259,7 +260,7 @@ func (f *Framework) SetEnvs(envs []string) {
func (f *Framework) WriteTempFile(name string, content string) string {
filePath := filepath.Join(f.TempDirectory, name)
err := os.WriteFile(filePath, []byte(content), 0766)
err := os.WriteFile(filePath, []byte(content), 0o766)
ExpectNoError(err)
return filePath
}