Skip to content

Commit c77f162

Browse files
Update check_for_updates.go
Co-authored-by: Luca Rinaldi <lucarin@protonmail.com>
1 parent 0b99a60 commit c77f162

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

check_for_updates.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ func checkForUpdates() (string, error) {
3131
return "", err
3232
}
3333

34-
c := updater.NewClient()
35-
req, err := http.NewRequest("GET", "https://api.github.com/repos/arduino/arduino-flasher-cli/releases/latest", nil)
34+
client := http.Client{Timeout: maxTime}
35+
resp, err := client.Get("https://api.github.com/repos/arduino/arduino-flasher-cli/releases/latest")
3636
if err != nil {
3737
return "", err
3838
}
39-
resp, err := c.HTTPClient.Do(req)
39+
defer resp.Body.Close()
4040
if err != nil {
4141
return "", err
4242
}

0 commit comments

Comments
 (0)