We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0e3618 commit 152f2c4Copy full SHA for 152f2c4
http/json/data.go
@@ -4,10 +4,9 @@ import (
4
goflagsmode "github.com/ralvarezdev/go-flags/mode"
5
gonethttp "github.com/ralvarezdev/go-net/http"
6
"net/http"
7
- "reflect"
8
)
9
10
-// checkJSONData checks if the given JSON data is nil or if the reflected data is not a pointer
+// checkJSONData checks if the given JSON data is nil
11
func checkJSONData(
12
w http.ResponseWriter,
13
data interface{},
@@ -17,11 +16,6 @@ func checkJSONData(
17
16
if data == nil {
18
return handleDataTypeError(w, ErrNilJSONData, mode)
19
}
20
-
21
- // Check if the reflected data is a pointer
22
- if reflect.ValueOf(data).Kind() != reflect.Ptr {
23
- return handleDataTypeError(w, ErrJSONDataMustBeAPointer, mode)
24
- }
25
return nil
26
27
0 commit comments