Skip to content

Commit

Permalink
close archive file #96
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Oct 10, 2022
1 parent e9f8ee2 commit 414ae4a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bundlegen/proxybundle/proxybundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ func archiveBundle(pathToZip, destinationPath string) (err error) {

pathSep := `/` //For archives/zip the path separator is always /

destinationFile, err = os.Create(destinationPath)
if err != nil {
if destinationFile, err = os.Create(destinationPath); err != nil {
return err
}

Expand Down Expand Up @@ -341,10 +340,13 @@ func archiveBundle(pathToZip, destinationPath string) (err error) {
return nil
})
if err != nil {
_ = destinationFile.Close()
return err
}
err = myZip.Close()
if err != nil {
if err = myZip.Close(); err != nil {
return err
}
if err = destinationFile.Close(); err != nil {
return err
}
return nil
Expand Down Expand Up @@ -436,7 +438,7 @@ func getApiProxyFolder(repoPath string) (apiProxyFolder string, apiProxyFile str
return apiProxyFolder, apiProxyFile
}

//downloadResource method is used to download resources, proxy bundles, sharedflows
// downloadResource method is used to download resources, proxy bundles, sharedflows
func downloadResource(repoPath string, url string) (err error) {

var apiproxyFolder, apiproxyFile string
Expand Down

0 comments on commit 414ae4a

Please sign in to comment.