Skip to content

Commit 1847e04

Browse files
fix: ensure Config for testing initialized
1 parent 1c33029 commit 1847e04

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

logger/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package logger
22

33
import (
44
"go.uber.org/zap"
5-
"go.uber.org/zap/zapcore"
65
)
76

87
// Config represents the configuration for creating a zap.Logger.
@@ -16,6 +15,6 @@ type Config struct {
1615
func NewConfig() Config {
1716
return Config{
1817
Format: "auto",
19-
Level: zap.NewAtomicLevelAt(zapcore.InfoLevel),
18+
Level: zap.NewAtomicLevel(),
2019
}
2120
}

toml/toml_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ func TestGroup_UnmarshalTOML(t *testing.T) {
141141
}
142142

143143
func TestConfig_Encode(t *testing.T) {
144-
var c run.Config
144+
var c *run.Config = run.NewConfig()
145145
c.Coordinator.WriteTimeout = itoml.Duration(time.Minute)
146146
buf := new(bytes.Buffer)
147-
if err := toml.NewEncoder(buf).Encode(&c); err != nil {
147+
if err := toml.NewEncoder(buf).Encode(c); err != nil {
148148
t.Fatal("Failed to encode: ", err)
149149
}
150150
got, search := buf.String(), `write-timeout = "1m0s"`

0 commit comments

Comments
 (0)