Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladimir Barsukov
zGo
Commits
8b5f72c0
Commit
8b5f72c0
authored
1 year ago
by
Vladimir Barsukov
Browse files
Options
Download
Email Patches
Plain Diff
GetJson
parent
5528fd07
master
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
zhttp/zhttp.go
+5
-1
zhttp/zhttp.go
with
5 additions
and
1 deletion
+5
-1
zhttp/zhttp.go
+
5
-
1
View file @
8b5f72c0
...
@@ -57,7 +57,7 @@ func (c *ZClient) GetEmpty(url string) error {
...
@@ -57,7 +57,7 @@ func (c *ZClient) GetEmpty(url string) error {
return
fmt
.
Errorf
(
"status code: %v"
,
resp
.
StatusCode
)
return
fmt
.
Errorf
(
"status code: %v"
,
resp
.
StatusCode
)
}
}
func
(
c
*
ZClient
)
GetJ
SON
(
target
any
,
url
string
)
error
{
func
(
c
*
ZClient
)
GetJ
son
(
target
any
,
url
string
)
error
{
var
err
error
var
err
error
var
resp
*
http
.
Response
var
resp
*
http
.
Response
...
@@ -68,3 +68,7 @@ func (c *ZClient) GetJSON(target any, url string) error {
...
@@ -68,3 +68,7 @@ func (c *ZClient) GetJSON(target any, url string) error {
return
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
target
)
return
json
.
NewDecoder
(
resp
.
Body
)
.
Decode
(
&
target
)
}
}
func
GetJson
(
target
any
,
url
string
)
error
{
return
Default
()
.
GetJson
(
target
,
url
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets