hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.
Mozilla Public License 2.0
1.65k stars 232 forks source link

v2: Url field isn't exported in Request type #404

Closed jukie closed 1 day ago

jukie commented 1 year ago

Field u should be exported in order to set the url when building a request. The current tests only function because it's executing from the same package: https://github.com/hashicorp/go-getter/blob/492324ccc87bf5c9459c6a137bd70a38cf792787/get_http_test.go#L42-L47

type Request struct {
    Src string
    Dst string
    Pwd string
    Forced string
    Umask os.FileMode
    GetMode Mode
    Copy bool
    Inplace bool
    ProgressListener ProgressTracker
    DisableSymlinks bool
    u               *url.URL
    subDir, realDst string
}
leopku commented 1 year ago

Same issue.

nywilken commented 1 year ago

@Jukie thanks again for the contribution, and for sticking with me on the additional time. I understand the need here. Go-Getter is written with the idea that all consumers will interact via the Client with a source URL that will get parsed and transformed into the underlying URL. But in this case it appears that you are trying to use the HTTPGetter directly, which does not allow for setting a URL at all. Please let me know if I'm misunderstanding the need for the request.

jukie commented 1 day ago

No longer needed