refactor: small changes and tweaks
This commit is contained in:
parent
568d3e21a6
commit
d408893389
2 changed files with 14 additions and 5 deletions
|
|
@ -118,3 +118,12 @@ func handleResponseError(res *http.Response, host, query string, err error) {
|
|||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// helper to write downloaded files
|
||||
func writeFiles(path string, body []byte) {
|
||||
var err = os.WriteFile(path, body, 0o755)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("failed to write file(s) from download")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue