add lint action (#19)
All checks were successful
Go Action / goaction (push) Successful in 19m15s
All checks were successful
Go Action / goaction (push) Successful in 19m15s
Reviewed-on: #19
This commit was merged in pull request #19.
This commit is contained in:
@@ -213,8 +213,8 @@ func ExampleNew_jsonFormat() {
|
||||
logger.Err(ctx, "same error message")
|
||||
logger.WarnKVs(ctx, "same warn message", "obj", Obj{Name: "obj name"})
|
||||
// Output:
|
||||
// {"msg":"same error message","level":"error","go-version":"go1.22.2"}
|
||||
// {"msg":"same warn message","obj":{"Name":"obj name","IsEnable":false},"level":"warning","go-version":"go1.22.2"}
|
||||
// {"msg":"same error message","level":"error","go-version":"go1.25.5"}
|
||||
// {"msg":"same warn message","obj":{"Name":"obj name","IsEnable":false},"level":"warning","go-version":"go1.25.5"}
|
||||
}
|
||||
|
||||
func ExampleNew_textEncoding() {
|
||||
@@ -227,8 +227,8 @@ func ExampleNew_textEncoding() {
|
||||
logger.InfoKVs(ctx, "same info message", "api-version", 0.1, "obj", Obj{Name: "text value", IsEnable: true})
|
||||
|
||||
// Output:
|
||||
// msg="same error message" level=error go-version=go1.22.2
|
||||
// msg="same info message" api-version=0.1 obj={Name:text value IsEnable:true} level=info go-version=go1.22.2
|
||||
// msg="same error message" level=error go-version=go1.25.5
|
||||
// msg="same info message" api-version=0.1 obj={Name:text value IsEnable:true} level=info go-version=go1.25.5
|
||||
}
|
||||
|
||||
type ctxKey string
|
||||
@@ -243,6 +243,7 @@ func levelInfo(ctx context.Context, entry *entry.Entry, handler log.Logger) (int
|
||||
|
||||
func ExampleWith() {
|
||||
var requestID ctxKey = "requestID"
|
||||
|
||||
vctx := context.WithValue(ctx, requestID, "6a5fa048-7181-11ea-bc55-0242ac130003")
|
||||
|
||||
logger := log.New(log.WithStdout()).With(
|
||||
@@ -252,7 +253,7 @@ func ExampleWith() {
|
||||
log.GoVersion("go"),
|
||||
)
|
||||
logger.Info(vctx, "same message")
|
||||
// Output: msg="same message" level=info requestID=6a5fa048-7181-11ea-bc55-0242ac130003 api=0.1.0 go=go1.22.2
|
||||
// Output: msg="same message" level=info requestID=6a5fa048-7181-11ea-bc55-0242ac130003 api=0.1.0 go=go1.25.5
|
||||
}
|
||||
|
||||
func ExampleLogger_Print() {
|
||||
@@ -263,7 +264,7 @@ func ExampleLogger_Print() {
|
||||
log.GoVersion("go"),
|
||||
)
|
||||
logger.Print("same message")
|
||||
// Output: msg="same message" level=info client=http api=0.1.0 go=go1.22.2
|
||||
// Output: msg="same message" level=info client=http api=0.1.0 go=go1.25.5
|
||||
}
|
||||
|
||||
func ExamplePrint() {
|
||||
|
||||
Reference in New Issue
Block a user