Skip to content

Commit f245c5d

Browse files
authored
test: always set entry timestamp (#75)
1 parent 690a7a9 commit f245c5d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

core_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package ecszap
2020
import (
2121
"errors"
2222
"testing"
23+
"time"
2324

2425
"github.com/stretchr/testify/assert"
2526
"github.com/stretchr/testify/require"
@@ -29,7 +30,7 @@ import (
2930
)
3031

3132
func TestCore(t *testing.T) {
32-
entry := zapcore.Entry{Level: zapcore.DebugLevel}
33+
entry := zapcore.Entry{Time: time.Now(), Level: zapcore.DebugLevel}
3334
fields := []zapcore.Field{
3435
zap.String("foo", "bar"),
3536
zap.Error(errors.New("boom")),

internal/spec/spec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package spec
1919

2020
import (
2121
"encoding/json"
22-
"io/ioutil"
22+
"os"
2323
"path"
2424
"path/filepath"
2525
"runtime"
@@ -96,7 +96,7 @@ func init() {
9696
panic("cannot recover information from runtime.Caller")
9797
}
9898
f := path.Join(filepath.ToSlash(filepath.Dir(filename)), "v1.json")
99-
b, err := ioutil.ReadFile(f)
99+
b, err := os.ReadFile(f)
100100
if err != nil {
101101
panic(errors.Wrap(err, "reading spec version 1 failed"))
102102
}

0 commit comments

Comments
 (0)