Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
24015e9a
Commit
24015e9a
authored
Nov 20, 2016
by
astaxie
Committed by
GitHub
Nov 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2285 from cat2neat/fix-bodyclose
Fix http body may not be closed
parents
27c59a80
9ff88f0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
jianliao.go
logs/jianliao.go
+1
-1
slack.go
logs/slack.go
+1
-1
No files found.
logs/jianliao.go
View file @
24015e9a
...
...
@@ -56,10 +56,10 @@ func (s *JLWriter) WriteMsg(when time.Time, msg string, level int) error {
if
err
!=
nil
{
return
err
}
defer
resp
.
Body
.
Close
()
if
resp
.
StatusCode
!=
http
.
StatusOK
{
return
fmt
.
Errorf
(
"Post webhook failed %s %d"
,
resp
.
Status
,
resp
.
StatusCode
)
}
resp
.
Body
.
Close
()
return
nil
}
...
...
logs/slack.go
View file @
24015e9a
...
...
@@ -44,10 +44,10 @@ func (s *SLACKWriter) WriteMsg(when time.Time, msg string, level int) error {
if
err
!=
nil
{
return
err
}
defer
resp
.
Body
.
Close
()
if
resp
.
StatusCode
!=
http
.
StatusOK
{
return
fmt
.
Errorf
(
"Post webhook failed %s %d"
,
resp
.
Status
,
resp
.
StatusCode
)
}
resp
.
Body
.
Close
()
return
nil
}
...
...
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