From 63369157b3043f45b75d06e7485dff117f0ec954 Mon Sep 17 00:00:00 2001 From: Marvin Preuss Date: Tue, 2 Apr 2024 07:36:47 +0000 Subject: [PATCH] style: happy linting --- httpslog/httpslog.go | 1 + internal/cache/cache_test.go | 2 -- internal/epoch/epoch_test.go | 12 ++++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/httpslog/httpslog.go b/httpslog/httpslog.go index 1aa738a..4d5b185 100644 --- a/httpslog/httpslog.go +++ b/httpslog/httpslog.go @@ -15,6 +15,7 @@ func Handler() func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { start := time.Now() lw := mutil.WrapWriter(w) + defer func() { // Logging. slog.Info( diff --git a/internal/cache/cache_test.go b/internal/cache/cache_test.go index 34c2266..ada26d8 100644 --- a/internal/cache/cache_test.go +++ b/internal/cache/cache_test.go @@ -79,8 +79,6 @@ func TestSave(t *testing.T) { is := is.New(t) for _, tt := range tables { - tt := tt - t.Run(tt.name, func(t *testing.T) { d := t.TempDir() diff --git a/internal/epoch/epoch_test.go b/internal/epoch/epoch_test.go index 4c9c0c2..8e60694 100644 --- a/internal/epoch/epoch_test.go +++ b/internal/epoch/epoch_test.go @@ -32,10 +32,8 @@ func TestMarshal(t *testing.T) { is := is.New(t) - for _, table := range tables { - tt := table - - t.Run(tt.name, func(t *testing.T) { + for _, tt := range tables { + t.Run(tt.name, func(_ *testing.T) { b, err := tt.input.MarshalJSON() if tt.err == nil { is.Equal(b, tt.expected) @@ -61,10 +59,8 @@ func TestUnmarshal(t *testing.T) { is := is.New(t) - for _, table := range tables { - tt := table - - t.Run(tt.name, func(t *testing.T) { + for _, tt := range tables { + t.Run(tt.name, func(_ *testing.T) { e := epoch.Epoch{} err := e.UnmarshalJSON(tt.input)