Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Nov 18, 2024
1 parent 50a4ce4 commit 1b1ea9c
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions Checker/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ func main() {
if err != nil {
return
}

defer func(Body io.ReadCloser) {
err := Body.Close()
if err != nil {
return
}
}(response.Body)
defer response.Body.Close()

html, err := io.ReadAll(response.Body)
if err != nil {
Expand Down Expand Up @@ -155,23 +149,13 @@ func downloadLatestVersion(versionString string) error {
if err != nil {
return err
}
defer func(Body io.ReadCloser) {
err := Body.Close()
if err != nil {
return
}
}(response.Body)
defer response.Body.Close()

storage, err := os.Create(fileName)
if err != nil {
return err
}
defer func(storage *os.File) {
err := storage.Close()
if err != nil {
return
}
}(storage)
defer storage.Close()

_, _ = io.Copy(storage, response.Body)

Expand Down

0 comments on commit 1b1ea9c

Please sign in to comment.