Skip to content

Commit

Permalink
bug fixing in response data
Browse files Browse the repository at this point in the history
bug fixing in response data
  • Loading branch information
Shipu authored Mar 6, 2022
1 parent 9ba2e71 commit 8df7bae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func (response ResponseBuilder) Build() interface{} {
response.Code(200)
}

if reflect.ValueOf(response.Response.Data).IsNil() {
data := reflect.TypeOf(response.Response.Data)
switch data.Kind() {
case reflect.Slice:
data := reflect.TypeOf(response.Response.Data)
switch data.Kind() {
case reflect.Slice:
if reflect.ValueOf(response.Response.Data).IsNil() {
response.Response.Data = make([]interface{}, 0)
}
}
Expand Down

0 comments on commit 8df7bae

Please sign in to comment.