hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[for go-getter v1] use `%w` instead of `%s` to wrap error

Ericwww opened this issue · comments

Hi all,

I am still working with go-getter v1.7.3.

I found that in this version, %s is used instead of %w when wrapping errors via fmt.Errorf.
As a result, callers of go-getter will not be able to handle errors gracefully through methods such as errors.As or errors.Unwrap.

If you think the above needs to be changed, I will take my effort to make a PR to fix this. 😃😃

Hi, @jbardin
Sorry to bother you.

I'm not sure if you are the maintainer of this repository.

If you had time, may you discuss this issue with core team and make a decision?

Thanks for this submission. We reviewed it today in triage. Although this is the correct action for modernizing error handing in go-getter, the go-getter project is not under active development and is essentially frozen. The requirements of the functionality that go-getter provides to terraform and other HashiCorp projects are met with the current implementation, and so barring a change in needed functionality, this project shall continue largely unchanged.

This is just to set expectations with regards to this pull request. I am happy to leave it open in case we decide to merge the functionality in the future. One thing to note, it seems you have committed the files with spaces changed to tabs, which creates a relatively noisy diff. If you intend to leave this PR open, you may want to correct that to make a future review easier to complete.

Thanks again for your interest and your submission!

@crw Thank you for your reply. I'd be happy to keep it open.

Some noisy change were probably due to go fmt tool or other format tool provided by IDE.

Now, I have fixed it.