The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
woop/aws-experiment-launch/experiment/utils/utils.go

30 lines
406 B

package utils
import (
"io"
"net/http"
"os"
)
func DownloadFile(filepath string, url string) {
// Create the file
out, err := os.Create(filepath)
if err != nil {
panic(err)
}
defer out.Close()
// Get the data
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
// Write the body to file
_, err = io.Copy(out, resp.Body)
if err != nil {
panic(err)
}
}