Skip to content

Commit 5bdee0a

Browse files
committed
lint: fix linter rules
Fixes linter rules after updating to v1.59.1.
1 parent f878e9d commit 5bdee0a

File tree

20 files changed

+40
-28
lines changed

20 files changed

+40
-28
lines changed

agent/client/client_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
)
1010

1111
func handler(w http.ResponseWriter, _ *http.Request) {
12+
// nolint
1213
fmt.Fprintln(w, "Hello from Piko")
1314
}
1415

agent/reverseproxy/reverseproxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestReverseProxy_Forward(t *testing.T) {
5858
t.Run("timeout", func(t *testing.T) {
5959
blockCh := make(chan struct{})
6060
upstream := httptest.NewServer(http.HandlerFunc(
61-
func(w http.ResponseWriter, r *http.Request) {
61+
func(_ http.ResponseWriter, _ *http.Request) {
6262
<-blockCh
6363
},
6464
))

cli/agent/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Examples:
6868
conf.RegisterFlags(cmd.PersistentFlags())
6969
loadConf.RegisterFlags(cmd.PersistentFlags())
7070

71-
cmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
71+
cmd.PersistentPreRun = func(_ *cobra.Command, _ []string) {
7272
if err := loadConf.Load(&conf); err != nil {
7373
fmt.Println(err.Error())
7474
os.Exit(1)

cli/agent/http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Timeout forwarding incoming HTTP requests to the upstream.`,
5454

5555
var logger log.Logger
5656

57-
cmd.PreRun = func(cmd *cobra.Command, args []string) {
57+
cmd.PreRun = func(_ *cobra.Command, args []string) {
5858
// Discard any listeners in the configuration file and use from command
5959
// line.
6060
conf.Listeners = []config.ListenerConfig{{
@@ -73,7 +73,7 @@ Timeout forwarding incoming HTTP requests to the upstream.`,
7373
}
7474
}
7575

76-
cmd.Run = func(cmd *cobra.Command, args []string) {
76+
cmd.Run = func(_ *cobra.Command, _ []string) {
7777
if err := runAgent(conf, logger); err != nil {
7878
logger.Error("failed to run agent", zap.Error(err))
7979
os.Exit(1)

cli/agent/start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Examples:
2525

2626
var logger log.Logger
2727

28-
cmd.PreRun = func(cmd *cobra.Command, args []string) {
28+
cmd.PreRun = func(_ *cobra.Command, _ []string) {
2929
var err error
3030
logger, err = log.NewLogger(conf.Log.Level, conf.Log.Subsystems)
3131
if err != nil {
@@ -39,7 +39,7 @@ Examples:
3939
}
4040
}
4141

42-
cmd.Run = func(cmd *cobra.Command, args []string) {
42+
cmd.Run = func(_ *cobra.Command, _ []string) {
4343
if err := runAgent(conf, logger); err != nil {
4444
logger.Error("failed to run agent", zap.Error(err))
4545
os.Exit(1)

cli/agent/tcp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Timeout connecting to the upstream.`,
5151

5252
var logger log.Logger
5353

54-
cmd.PreRun = func(cmd *cobra.Command, args []string) {
54+
cmd.PreRun = func(_ *cobra.Command, args []string) {
5555
// Discard any listeners in the configuration file and use from command
5656
// line.
5757
conf.Listeners = []config.ListenerConfig{{
@@ -70,7 +70,7 @@ Timeout connecting to the upstream.`,
7070
}
7171
}
7272

73-
cmd.Run = func(cmd *cobra.Command, args []string) {
73+
cmd.Run = func(_ *cobra.Command, _ []string) {
7474
if err := runAgent(conf, logger); err != nil {
7575
logger.Error("failed to run agent", zap.Error(err))
7676
os.Exit(1)

cli/forward/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Examples:
4949
conf.RegisterFlags(cmd.PersistentFlags())
5050
loadConf.RegisterFlags(cmd.PersistentFlags())
5151

52-
cmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
52+
cmd.PersistentPreRun = func(_ *cobra.Command, _ []string) {
5353
if err := loadConf.Load(&conf); err != nil {
5454
fmt.Println(err.Error())
5555
os.Exit(1)

cli/forward/start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Examples:
2525

2626
var logger log.Logger
2727

28-
cmd.PreRun = func(cmd *cobra.Command, args []string) {
28+
cmd.PreRun = func(_ *cobra.Command, _ []string) {
2929
var err error
3030
logger, err = log.NewLogger(conf.Log.Level, conf.Log.Subsystems)
3131
if err != nil {
@@ -39,7 +39,7 @@ Examples:
3939
}
4040
}
4141

42-
cmd.Run = func(cmd *cobra.Command, args []string) {
42+
cmd.Run = func(_ *cobra.Command, _ []string) {
4343
if err := runForward(conf, logger); err != nil {
4444
logger.Error("failed to run forward", zap.Error(err))
4545
os.Exit(1)

cli/forward/tcp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Examples:
3030

3131
var logger log.Logger
3232

33-
cmd.PreRun = func(cmd *cobra.Command, args []string) {
33+
cmd.PreRun = func(_ *cobra.Command, args []string) {
3434
// Discard any ports in the configuration file and use from command
3535
// line.
3636
conf.Ports = []config.PortConfig{{
@@ -46,7 +46,7 @@ Examples:
4646
}
4747
}
4848

49-
cmd.Run = func(cmd *cobra.Command, args []string) {
49+
cmd.Run = func(_ *cobra.Command, _ []string) {
5050
if err := runForward(conf, logger); err != nil {
5151
logger.Error("failed to run forward", zap.Error(err))
5252
os.Exit(1)

cli/server/command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Examples:
8080

8181
var logger log.Logger
8282

83-
cmd.PreRun = func(cmd *cobra.Command, args []string) {
83+
cmd.PreRun = func(_ *cobra.Command, _ []string) {
8484
if err := loadConf.Load(&conf); err != nil {
8585
fmt.Println(err.Error())
8686
os.Exit(1)
@@ -134,7 +134,7 @@ Examples:
134134
}
135135
}
136136

137-
cmd.Run = func(cmd *cobra.Command, args []string) {
137+
cmd.Run = func(_ *cobra.Command, _ []string) {
138138
if err := runServer(&conf, logger); err != nil {
139139
logger.Error("failed to run agent", zap.Error(err))
140140
os.Exit(1)

0 commit comments

Comments
 (0)