Skip to content

Commit 01e0094

Browse files
committed
Fix lint warnings
1 parent c45abf0 commit 01e0094

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ghdoc.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ func (doc *GHDoc) Convert2HTML() error {
9999
if doc.Debug {
100100
htmlFile := doc.Path + ".debug.html"
101101
doc.d("Convert2HTML: write html file: " + htmlFile)
102-
ioutil.WriteFile(htmlFile, []byte(htmlBody), 0644)
102+
if err := ioutil.WriteFile(htmlFile, []byte(htmlBody), 0644); err != nil {
103+
return err
104+
}
103105
}
104106
doc.html = htmlBody
105107
return nil

internals.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ func httpPost(urlPath, filePath, token string) (string, error) {
5757
defer file.Close()
5858

5959
body := &bytes.Buffer{}
60-
io.Copy(body, file)
60+
_, err = io.Copy(body, file)
61+
if err != nil {
62+
return "", err
63+
}
6164

6265
req, err := http.NewRequest("POST", urlPath, body)
6366
if err != nil {

0 commit comments

Comments
 (0)