I try to download like it, but failed and the error is no source URL was returned
var httpGetter = &getter.HttpGetter{
// Disable pre-fetch HEAD requests
DoNotCheckHeadFirst: true,
// As an alternative to the above setting, you can
// set a reasonable timeout for HEAD requests
// HeadFirstTimeout: 10 * time.Second,
// Read timeout for HTTP operations
ReadTimeout: 30 * time.Second,
// Set the maximum number of bytes
// that can be read by the getter
MaxBytes: 500000000, // 500 MB
}
dest, err := url.Parse("https://mirrors.tuna.tsinghua.edu.cn/cygwin/noarch/sha512.sum")
fmt.Println(err)
err = httpGetter.Get("./hack", dest)
if err != nil {
fmt.Println(err)
}
I try to download like it, but failed and the error is
no source URL was returned