Skip to content
Permalink
Browse files
优化为switch方式
  • Loading branch information
Changeden committed Oct 12, 2021
1 parent 53cd523 commit 021477840946c8f14eead40c97c3c26616083e57
Showing 1 changed file with 1 addition and 1 deletion.
@@ -164,7 +164,7 @@ func (e *Encoder) Encode(v interface{}) error {
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
reflect.Float32, reflect.Float64: // solve base type
vVal := reflect.ValueOf(v)
if !vVal.IsNil() {
if reflect.Ptr == vVal.Kind() && !vVal.IsNil() {
return e.Encode(vVal.Elem().Interface())
}
case reflect.Struct:

0 comments on commit 0214778

Please sign in to comment.