From 26074755ff519cd94a94a3a054bbadfdaa0b5417 Mon Sep 17 00:00:00 2001 From: kruskall <99559985+kruskall@users.noreply.github.com> Date: Thu, 25 Jul 2024 10:40:21 +0200 Subject: [PATCH] test: always set entry timestamp --- core_test.go | 3 ++- internal/spec/spec.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core_test.go b/core_test.go index 3bae4be..6cf3cec 100644 --- a/core_test.go +++ b/core_test.go @@ -20,6 +20,7 @@ package ecszap import ( "errors" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -29,7 +30,7 @@ import ( ) func TestCore(t *testing.T) { - entry := zapcore.Entry{Level: zapcore.DebugLevel} + entry := zapcore.Entry{Time: time.Now(), Level: zapcore.DebugLevel} fields := []zapcore.Field{ zap.String("foo", "bar"), zap.Error(errors.New("boom")), diff --git a/internal/spec/spec.go b/internal/spec/spec.go index 32f5578..21ea516 100644 --- a/internal/spec/spec.go +++ b/internal/spec/spec.go @@ -19,7 +19,7 @@ package spec import ( "encoding/json" - "io/ioutil" + "os" "path" "path/filepath" "runtime" @@ -96,7 +96,7 @@ func init() { panic("cannot recover information from runtime.Caller") } f := path.Join(filepath.ToSlash(filepath.Dir(filename)), "v1.json") - b, err := ioutil.ReadFile(f) + b, err := os.ReadFile(f) if err != nil { panic(errors.Wrap(err, "reading spec version 1 failed")) }