File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -34,19 +34,18 @@ func Download(sg *sync.WaitGroup) {
3434 if err != nil {
3535 log .Fatalln ("Create file error:" + err .Error ())
3636 }
37+ defer file .Close ()
3738
3839 writer := bufio .NewWriter (file )
3940 client := http.Client {}
4041 resp , err := client .Get ("https://github.com/project-yui/Yui-patch/releases/download/v1.1.3/yui-libfiddler-linux-x86_64-v1.1.3.so" )
4142 if err != nil {
42- file .Close ()
4343 log .Fatalln ("Download fiddler.so error:" + err .Error ())
4444 }
4545 defer resp .Body .Close ()
4646
4747 fileSize , err := io .Copy (writer , resp .Body )
4848
49- file .Close ()
5049 if err != nil {
5150 log .Fatalln ("Write file error:" + err .Error ())
5251 }
Original file line number Diff line number Diff line change @@ -34,19 +34,18 @@ func Download(sg *sync.WaitGroup) {
3434 if err != nil {
3535 log .Fatalln ("Create file error:" + err .Error ())
3636 }
37+ defer file .Close ()
3738
3839 writer := bufio .NewWriter (file )
3940 client := http.Client {}
4041 resp , err := client .Get ("https://github.com/project-yui/Yui-patch/releases/download/v1.1.3/yui-fiddler-win32-x86_64-v1.1.3.dll" )
4142 if err != nil {
42- file .Close ()
4343 log .Fatalln ("Download fiddler.dll error:" + err .Error ())
4444 }
4545 defer resp .Body .Close ()
4646
4747 fileSize , err := io .Copy (writer , resp .Body )
4848
49- file .Close ()
5049 if err != nil {
5150 log .Fatalln ("Write file error:" + err .Error ())
5251 }
You can’t perform that action at this time.
0 commit comments