From c554529df51ea484319e5a5c9acdbcee99fa32f3 Mon Sep 17 00:00:00 2001 From: Yaser Azfar Date: Tue, 3 Dec 2019 15:56:58 +1300 Subject: [PATCH] add err checking for places where an error variable was assigned but not checked --- zh-tw/a_herf.go | 3 +++ zh-tw/build_new.go | 3 +++ zh/a_herf.go | 3 +++ zh/build_new.go | 3 +++ 4 files changed, 12 insertions(+) diff --git a/zh-tw/a_herf.go b/zh-tw/a_herf.go index 2e6d8493..86363789 100644 --- a/zh-tw/a_herf.go +++ b/zh-tw/a_herf.go @@ -43,6 +43,9 @@ func htmlfile(filename string,next_path string,last_path string)(error){ var add_string2 string = "\n下一页\n" file.Seek(1,2) _,err=file.WriteString(add_string1) + if(err!=nil){ + fmt.Println("err:",err) + } _,err=file.WriteString(add_string2) file.Seek(0,0) if(err!=nil){ diff --git a/zh-tw/build_new.go b/zh-tw/build_new.go index b3e04c11..70c939b6 100644 --- a/zh-tw/build_new.go +++ b/zh-tw/build_new.go @@ -79,6 +79,9 @@ func (self *Visitor) md2html(arg map[string]string) error { req.Header.Set("Authorization", "token "+token) // resp, err := client.Do(req) + if err != nil { + fmt.Println("err:",err) + } defer resp.Body.Close() diff --git a/zh/a_herf.go b/zh/a_herf.go index 2e6d8493..86363789 100644 --- a/zh/a_herf.go +++ b/zh/a_herf.go @@ -43,6 +43,9 @@ func htmlfile(filename string,next_path string,last_path string)(error){ var add_string2 string = "\n下一页\n" file.Seek(1,2) _,err=file.WriteString(add_string1) + if(err!=nil){ + fmt.Println("err:",err) + } _,err=file.WriteString(add_string2) file.Seek(0,0) if(err!=nil){ diff --git a/zh/build_new.go b/zh/build_new.go index b3e04c11..1414894f 100644 --- a/zh/build_new.go +++ b/zh/build_new.go @@ -79,6 +79,9 @@ func (self *Visitor) md2html(arg map[string]string) error { req.Header.Set("Authorization", "token "+token) // resp, err := client.Do(req) + if err!=nil { + fmt.Println("err:",err) + } defer resp.Body.Close()