From 596e80c3f30ea8ce539b3037b0900ecb3677fe5b Mon Sep 17 00:00:00 2001 From: shaobo322 <37969177+shaobo322@users.noreply.github.com> Date: Wed, 8 May 2019 19:51:57 +0800 Subject: [PATCH] fix bug field type spell (#87) --- pkg/log/field.go | 2 +- pkg/log/internal/core/field.go | 4 ++-- pkg/log/util.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/log/field.go b/pkg/log/field.go index 144af2fd3..d235cea76 100644 --- a/pkg/log/field.go +++ b/pkg/log/field.go @@ -18,7 +18,7 @@ func KVString(key string, value string) D { // KVInt construct Field with int value. func KVInt(key string, value int) D { - return D{Key: key, Type: core.IntTpye, Int64Val: int64(value)} + return D{Key: key, Type: core.IntType, Int64Val: int64(value)} } // KVInt64 construct D with int64 value. diff --git a/pkg/log/internal/core/field.go b/pkg/log/internal/core/field.go index 99c78325b..ea91bd784 100644 --- a/pkg/log/internal/core/field.go +++ b/pkg/log/internal/core/field.go @@ -15,7 +15,7 @@ type FieldType int32 const ( UnknownType FieldType = iota StringType - IntTpye + IntType Int64Type UintType Uint64Type @@ -43,7 +43,7 @@ func (f Field) AddTo(enc ObjectEncoder) { switch f.Type { case StringType: enc.AddString(f.Key, f.StringVal) - case IntTpye: + case IntType: enc.AddInt(f.Key, int(f.Int64Val)) case Int64Type: enc.AddInt64(f.Key, f.Int64Val) diff --git a/pkg/log/util.go b/pkg/log/util.go index 724c5f064..9e9f74893 100644 --- a/pkg/log/util.go +++ b/pkg/log/util.go @@ -45,7 +45,7 @@ func toMap(args ...D) map[string]interface{} { d := make(map[string]interface{}, 10+len(args)) for _, arg := range args { switch arg.Type { - case core.UintType, core.Uint64Type, core.IntTpye, core.Int64Type: + case core.UintType, core.Uint64Type, core.IntType, core.Int64Type: d[arg.Key] = arg.Int64Val case core.StringType: d[arg.Key] = arg.StringVal