Skip to content

Commit 73e199e

Browse files
committed
Fix issues from golangci-lint
1 parent 8c2da6e commit 73e199e

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

cmd/healthcheck.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ func newHealthcheckCmd(cfg *config.Config) *ff.Command {
1616
Name: "healthcheck",
1717
Usage: "healthcheck [flags]",
1818
ShortHelp: "Check if the server is running",
19-
Exec: func(ctx context.Context, args []string) error {
19+
Exec: func(ctx context.Context, _ []string) error {
2020
// Create a new client
2121
client := &http.Client{
22-
Timeout: 5 * time.Second, //nolint:gomnd // We want to use a constant
22+
Timeout: 5 * time.Second, //nolint:mnd // We want to use a constant
2323
}
2424

2525
// Create a new request

cmd/serve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func newServerCmd(cfg *config.Config) *ff.Command {
1919
Name: "serve",
2020
Usage: "serve [flags]",
2121
ShortHelp: "Start the webfinger server",
22-
Exec: func(ctx context.Context, args []string) error {
22+
Exec: func(ctx context.Context, _ []string) error {
2323
// Create a logger and add it to the context
2424
l := log.NewLogger(os.Stderr, cfg)
2525
ctx = log.WithLogger(ctx, l)

internal/middleware/log_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestRequestLogger(t *testing.T) {
3030
t.Error("logger logged before request")
3131
}
3232

33-
middleware.RequestLogger(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
33+
middleware.RequestLogger(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
3434
w.WriteHeader(http.StatusOK)
3535
})).ServeHTTP(w, r)
3636

internal/middleware/recover_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestRecoverer(t *testing.T) {
3838
w := httptest.NewRecorder()
3939
r, _ := http.NewRequestWithContext(ctx, http.MethodGet, "/", http.NoBody)
4040

41-
h := middleware.Recoverer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
41+
h := middleware.Recoverer(http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {
4242
panic("test")
4343
}))
4444

@@ -61,7 +61,7 @@ func TestRecoverer(t *testing.T) {
6161
w := httptest.NewRecorder()
6262
r, _ := http.NewRequestWithContext(ctx, http.MethodGet, "/", http.NoBody)
6363

64-
h := middleware.Recoverer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
64+
h := middleware.Recoverer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
6565
w.WriteHeader(http.StatusOK)
6666
}))
6767

internal/server/healthcheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func HealthCheckHandler(_ *config.Config) http.Handler {
10-
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
10+
return http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
1111
w.WriteHeader(http.StatusOK)
1212
})
1313
}

internal/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func StartServer(ctx context.Context, cfg *config.Config, fingers webfingers.Web
6868
return egCtx
6969
}
7070

71-
return srv.ListenAndServe() //nolint:wrapcheck // We wrap the error in the errgroup
71+
return srv.ListenAndServe()
7272
})
7373
// Gracefully shutdown the server when the context is done
7474
eg.Go(func() error {
@@ -80,7 +80,7 @@ func StartServer(ctx context.Context, cfg *config.Config, fingers webfingers.Web
8080
// the server to shutdown if the context is canceled.
8181
noCancelCtx := context.WithoutCancel(egCtx)
8282

83-
return srv.Shutdown(noCancelCtx) //nolint:wrapcheck // We wrap the error in the errgroup
83+
return srv.Shutdown(noCancelCtx)
8484
})
8585

8686
// Log when the server is fully shutdown

0 commit comments

Comments
 (0)