Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
orangecat
ollama
Commits
c5f21f73
"vscode:/vscode.git/clone" did not exist on "9959a7a6a5c8e8c1a83d0ef082e806fbd280a7c6"
Unverified
Commit
c5f21f73
authored
Dec 25, 2023
by
Icelain
Committed by
GitHub
Dec 25, 2023
Browse files
follow best practices by adding resp.Body.Close() (#1708)
parent
371bc735
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
examples/golang-simplegenerate/main.go
examples/golang-simplegenerate/main.go
+2
-0
No files found.
examples/golang-simplegenerate/main.go
View file @
c5f21f73
...
@@ -18,6 +18,8 @@ func main() {
...
@@ -18,6 +18,8 @@ func main() {
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
defer
resp
.
Body
.
Close
()
responseData
,
err
:=
io
.
ReadAll
(
resp
.
Body
)
responseData
,
err
:=
io
.
ReadAll
(
resp
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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