Skip to content

Commit

Permalink
Fix http request pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
christianezeani committed Dec 6, 2024
1 parent 8e05c82 commit e8cdc11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http/fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Request[T any](method, url string, opts ...*RequestOptions) (data T, err er
// Parse JSON Content
switch vType.Kind() {
case reflect.Pointer:
data = reflect.New(vType).Interface().(T)
data = reflect.New(vType.Elem()).Interface().(T)
err2 = json.Unmarshal(b, data)
default:
err2 = json.Unmarshal(b, &data)
Expand Down

0 comments on commit e8cdc11

Please sign in to comment.