adjust code style about config (#3464)

This commit is contained in:
fatedier
2023-05-30 20:25:22 +08:00
committed by GitHub
parent 341a5e3e3a
commit 9aef3b9944
29 changed files with 262 additions and 474 deletions

View File

@@ -79,7 +79,7 @@ var httpCmd = &cobra.Command{
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -71,7 +71,7 @@ var httpsCmd = &cobra.Command{
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -78,7 +78,7 @@ var stcpCmd = &cobra.Command{
os.Exit(1)
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -95,7 +95,7 @@ var stcpCmd = &cobra.Command{
cfg.ServerName = serverName
cfg.BindAddr = bindAddr
cfg.BindPort = bindPort
err = cfg.Check()
err = cfg.Validate()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -78,7 +78,7 @@ var sudpCmd = &cobra.Command{
os.Exit(1)
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -95,7 +95,7 @@ var sudpCmd = &cobra.Command{
cfg.ServerName = serverName
cfg.BindAddr = bindAddr
cfg.BindPort = bindPort
err = cfg.Check()
err = cfg.Validate()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -68,7 +68,7 @@ var tcpCmd = &cobra.Command{
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -73,7 +73,7 @@ var tcpMuxCmd = &cobra.Command{
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -68,7 +68,7 @@ var udpCmd = &cobra.Command{
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -78,7 +78,7 @@ var xtcpCmd = &cobra.Command{
os.Exit(1)
}
cfg.BandwidthLimitMode = bandwidthLimitMode
err = cfg.CheckForCli()
err = cfg.ValidateForClient()
if err != nil {
fmt.Println(err)
os.Exit(1)
@@ -95,7 +95,7 @@ var xtcpCmd = &cobra.Command{
cfg.ServerName = serverName
cfg.BindAddr = bindAddr
cfg.BindPort = bindPort
err = cfg.Check()
err = cfg.Validate()
if err != nil {
fmt.Println(err)
os.Exit(1)