Skip to content

Commit c5b26bd

Browse files
committed
gofmt
1 parent 8dd70ac commit c5b26bd

35 files changed

+108
-113
lines changed

context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package countlog
22

33
import (
4-
"unsafe"
54
"context"
65
"github.com/modern-go/countlog/logger"
76
"github.com/modern-go/reflect2"
7+
"unsafe"
88
)
99

1010
func Ctx(ctx context.Context) *Context {
@@ -124,4 +124,4 @@ func (ctx *Context) Fatal(event string, properties ...interface{}) {
124124
func (ctx *Context) Add(key string, value interface{}) {
125125
ctx.logContext.Properties = append(ctx.logContext.Properties, key)
126126
ctx.logContext.Properties = append(ctx.logContext.Properties, value)
127-
}
127+
}

countlog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package countlog
22

33
import (
44
"github.com/modern-go/countlog/logger"
5-
"unsafe"
65
"github.com/modern-go/reflect2"
76
"runtime/debug"
7+
"unsafe"
88
)
99

1010
const LevelTraceCall = logger.LevelTraceCall

countlog_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package countlog_test
22

33
import (
4-
"testing"
5-
"github.com/modern-go/test"
4+
"bytes"
65
"context"
6+
"github.com/json-iterator/go"
77
"github.com/modern-go/countlog"
8-
"github.com/modern-go/countlog/output"
9-
"bytes"
108
"github.com/modern-go/countlog/format/jsonlog"
11-
"github.com/json-iterator/go"
9+
"github.com/modern-go/countlog/output"
10+
"github.com/modern-go/test"
1211
"github.com/modern-go/test/must"
12+
"testing"
1313
)
1414

1515
func TestCountlog(t *testing.T) {
@@ -23,4 +23,4 @@ func TestCountlog(t *testing.T) {
2323
countlog.Trace("hello", "key", "value")
2424
must.Equal("hello", jsoniter.Get(buf.Bytes(), "event").ToString())
2525
}))
26-
}
26+
}

format/compact/compact.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package compact
22

33
import (
4-
"github.com/modern-go/countlog/logger"
5-
"github.com/modern-go/countlog/format"
64
"fmt"
5+
"github.com/modern-go/countlog/format"
6+
"github.com/modern-go/countlog/logger"
77
"strings"
88
)
99

format/compact/compact_test.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package compact_test
22

33
import (
4-
"testing"
5-
"github.com/modern-go/test"
64
"context"
5+
"errors"
76
"github.com/modern-go/countlog/format/compact"
87
"github.com/modern-go/countlog/logger"
8+
"github.com/modern-go/test"
99
"github.com/modern-go/test/must"
10-
"errors"
10+
"testing"
1111
)
1212

1313
func TestCompact(t *testing.T) {
@@ -19,8 +19,7 @@ func TestCompact(t *testing.T) {
1919
}).FormatterOf(&logger.LogSite{
2020
Event: "event!hello",
2121
})
22-
must.Equal("hello\n", string(fmt.Format(nil, &logger.Event{
23-
})))
22+
must.Equal("hello\n", string(fmt.Format(nil, &logger.Event{})))
2423
}))
2524
t.Run("callee", test.Case(func(ctx context.Context) {
2625
fmt := (&compact.Format{
@@ -30,8 +29,7 @@ func TestCompact(t *testing.T) {
3029
}).FormatterOf(&logger.LogSite{
3130
Event: "callee!hello",
3231
})
33-
must.Equal("call hello\n", string(fmt.Format(nil, &logger.Event{
34-
})))
32+
must.Equal("call hello\n", string(fmt.Format(nil, &logger.Event{})))
3533
}))
3634
t.Run("msg", test.Case(func(ctx context.Context) {
3735
fmt := (&compact.Format{

format/compact/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ func formatContext(key string, sample []interface{}) format.Formatter {
1313
ctx := logger.GetLogContext(event.Context)
1414
return formatter.Format(space, ctx.Properties)
1515
})
16-
}
16+
}

format/compact/level.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package compact
22

33
import (
4-
"github.com/modern-go/countlog/logger"
54
"github.com/modern-go/countlog/format"
5+
"github.com/modern-go/countlog/logger"
66
)
77

88
func formatLevel() format.Formatter {

format/compact/message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ func formatProperties(key string, sample []interface{}) format.Formatter {
1212
return format.FuncFormatter(func(space []byte, event *logger.Event) []byte {
1313
return formatter.Format(space, event.Properties)
1414
})
15-
}
15+
}

format/compact/properties.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ func formatMessage(pattern string, sample []interface{}) format.Formatter {
1111
return format.FuncFormatter(func(space []byte, event *logger.Event) []byte {
1212
return formatter.Format(space, event.Properties)
1313
})
14-
}
14+
}

format/format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ type FuncFormatter func(space []byte, event *logger.Event) []byte
2323

2424
func (f FuncFormatter) Format(space []byte, event *logger.Event) []byte {
2525
return f(space, event)
26-
}
26+
}

0 commit comments

Comments
 (0)