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)