Skip to content

Commit

Permalink
Update encode.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sesky4 committed Sep 13, 2024
1 parent fb3b3e8 commit f5b4567
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tencentcloud/common/json/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,10 @@ func isEmptyValue(v reflect.Value) bool {
}

func isNilValue(v reflect.Value) bool {
// unsafe.UnsafePointer doesn't exist in go1.9
const UnsafePointer = 26
switch v.Kind() {
case reflect.Array, reflect.Map, reflect.Slice, reflect.String, reflect.Interface, reflect.Ptr:
case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, UnsafePointer, reflect.Interface, reflect.Slice:
return v.IsNil()
}
return false
Expand Down

0 comments on commit f5b4567

Please sign in to comment.