From a9803c50f2dca2f187b10ec95ca8f1a6a7336242 Mon Sep 17 00:00:00 2001 From: appleboy Date: Sat, 2 Mar 2024 11:12:20 +0800 Subject: [PATCH] refactor: refactor testing functions in zap_test file - Change the `timestampLocationCheck` function signature to remove the `*testing.T` parameter - Update calls to `timestampLocationCheck` to match the new function signature in `zap_test.go` Signed-off-by: appleboy --- zap_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zap_test.go b/zap_test.go index 7b71a0e..6307c2e 100644 --- a/zap_test.go +++ b/zap_test.go @@ -24,7 +24,7 @@ func buildDummyLogger() (*zap.Logger, *observer.ObservedLogs) { return logger, obs } -func timestampLocationCheck(t *testing.T, timestampStr string, location *time.Location) error { +func timestampLocationCheck(timestampStr string, location *time.Location) error { timestamp, err := time.Parse(time.RFC3339, timestampStr) if err != nil { return err @@ -63,7 +63,7 @@ func TestGinzap(t *testing.T) { t.Fatalf("logged path should be /test but %s", pathStr) } - err := timestampLocationCheck(t, logLine.Context[7].String, time.UTC) + err := timestampLocationCheck(logLine.Context[7].String, time.UTC) if err != nil { t.Fatal(err) } @@ -120,7 +120,7 @@ func TestGinzapWithConfig(t *testing.T) { t.Fatalf("logged path should be /test but %s", pathStr) } - err := timestampLocationCheck(t, logLine.Context[7].String, time.UTC) + err := timestampLocationCheck(logLine.Context[7].String, time.UTC) if err != nil { t.Fatal(err) }