mirror of
https://github.com/go-kratos/kratos.git
synced 2025-02-09 13:36:57 +02:00
fix bug field type spell (#87)
This commit is contained in:
parent
e7ecfe7ec4
commit
596e80c3f3
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user