lint by golangci-lint (#3080)

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

No files matched your search

+4 -7
View File
@@ -18,14 +18,14 @@ import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/auth"
"github.com/fatedier/frp/pkg/config"
"github.com/fatedier/frp/pkg/util/log"
"github.com/fatedier/frp/pkg/util/util"
"github.com/fatedier/frp/pkg/util/version"
"github.com/fatedier/frp/server"
"github.com/spf13/cobra"
)
const (
@@ -50,16 +50,13 @@ var (
dashboardUser string
dashboardPwd string
enablePrometheus bool
assetsDir string
logFile string
logLevel string
logMaxDays int64
disableLogColor bool
token string
subDomainHost string
tcpMux bool
allowPorts string
maxPoolCount int64
maxPortsPerClient int64
tlsOnly bool
dashboardTLSMode bool
@@ -151,7 +148,7 @@ func parseServerCommonCfg(fileType int, source []byte) (cfg config.ServerCommonC
cfg.Complete()
err = cfg.Validate()
if err != nil {
err = fmt.Errorf("Parse config error: %v", err)
err = fmt.Errorf("parse config error: %v", err)
return
}
return
@@ -189,7 +186,7 @@ func parseServerCommonCfgFromCmd() (cfg config.ServerCommonConf, err error) {
// e.g. 1000-2000,2001,2002,3000-4000
ports, errRet := util.ParseRangeNumbers(allowPorts)
if errRet != nil {
err = fmt.Errorf("Parse conf error: allow_ports: %v", errRet)
err = fmt.Errorf("parse conf error: allow_ports: %v", errRet)
return
}
+2 -2
View File
@@ -18,9 +18,9 @@ import (
"fmt"
"os"
"github.com/fatedier/frp/pkg/config"
"github.com/spf13/cobra"
"github.com/fatedier/frp/pkg/config"
)
func init() {