refactor: small changes and tweaks

This commit is contained in:
David Allen 2025-09-05 22:21:00 -06:00
parent 568d3e21a6
commit d408893389
Signed by: towk
GPG key ID: 0430CDBE22619155
2 changed files with 14 additions and 5 deletions

View file

@ -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)
}
}