Skip to content

Commit 6dabcdd

Browse files
authored
Merge pull request #9 from andrew-field/use-defer-function-for-tmpfile
Use defer function for tmpfile
2 parents 7bcd971 + b8b645b commit 6dabcdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ func fixPermissions(root string) error {
277277
func downloadAndInstall(dl *GoDownload) error {
278278
tmpfile, shasum, err := downloadFile(dl)
279279
if err != nil {
280-
return fmt.Errorf("download failed: %v", err)
280+
return fmt.Errorf("tmpfile download failed: %v", err)
281+
} else {
282+
fmt.Printf("tmpfile downloaded successfully into %v\n", tmpfile)
281283
}
282284
if shasum != dl.SHA256 {
283285
return fmt.Errorf("bad checksum, expected %s got %s", dl.SHA256, shasum)

0 commit comments

Comments
 (0)