-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove github.com/hashicorp/go-multierror Direct Dependency #99
Comments
3 tasks
#63, once merged, will provide an |
bflad
added a commit
that referenced
this issue
Sep 6, 2023
…ndency Reference: https://pkg.go.dev/errors#Join Reference: https://pkg.go.dev/math/rand#Seed Reference: #99 Reference: #180 Previously from `golangci-lint` after Go 1.20 upgrade: ``` helper/acctest/random.go:24:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (staticcheck) rand.Seed(time.Now().UTC().UnixNano()) ^ ``` Fully removing the go-multierror dependency will require some other upstream updates, e.g. ``` # github.com/hashicorp/go-multierror github.com/hashicorp/terraform-plugin-testing/helper/resource github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema github.com/hashicorp/go-multierror ```
bflad
added a commit
that referenced
this issue
Sep 6, 2023
…ndency (#181) Reference: https://pkg.go.dev/errors#Join Reference: https://pkg.go.dev/math/rand#Seed Reference: #99 Reference: #180 Previously from `golangci-lint` after Go 1.20 upgrade: ``` helper/acctest/random.go:24:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (staticcheck) rand.Seed(time.Now().UTC().UnixNano()) ^ ``` Fully removing the go-multierror dependency will require some other upstream updates, e.g. ``` # github.com/hashicorp/go-multierror github.com/hashicorp/terraform-plugin-testing/helper/resource github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema github.com/hashicorp/go-multierror ```
bflad
added a commit
to hashicorp/terraform-plugin-sdk
that referenced
this issue
Sep 6, 2023
Reference: hashicorp/terraform-plugin-testing#99 Similar to terraform-plugin-testing, now that this Go module is Go 1.20+, we can use native `errors.Join()` functionality for joining multiple errors. To fully remove the dependency, will need to update some other dependencies as well, e.g. ``` # github.com/hashicorp/go-multierror github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest github.com/hashicorp/hc-install github.com/hashicorp/go-multierror ```
bflad
added a commit
to hashicorp/terraform-plugin-sdk
that referenced
this issue
Sep 6, 2023
) Reference: hashicorp/terraform-plugin-testing#99 Similar to terraform-plugin-testing, now that this Go module is Go 1.20+, we can use native `errors.Join()` functionality for joining multiple errors. To fully remove the dependency, will need to update some other dependencies as well, e.g. ``` # github.com/hashicorp/go-multierror github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugintest github.com/hashicorp/hc-install github.com/hashicorp/go-multierror ```
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
terraform-plugin-testing version
Description
github.com/hashicorp/go-multierror
has been HashiCorp's generic "multiple errors in one error" solution well before Go 1.13 introduced error unwrapping. Go 1.20, released recently, now also includes native multiple error functionality viaerrors.Join(...error)
. According to this Go module's Go language support policy, it must support Go 1.19 until Go 1.21 is released in the August 2023 timeframe.There are three usages of
go-multierror
:helper/resource.ComposeAggregateTestCheckFunc
helper/resource.TestComposeAggregateTestCheckFunc
(*terraform.State).Validate
Removing
github.com/hashicorp/go-multierror
would also removegithub.com/hashicorp/errwrap
-- but it may take a few other dependency changes to fully prune out both these Go modules.Proposal
These code references can be migrated to collect errors in an
[]error
and then combined with formatting similar togo-multierror
orerrors.Join()
. If nothing has happened for this issue when this Go module updates its minimum Go version to Go 1.20, thengo-multierror
code can be migrated toerrors.Join()
instead of manually formatting.References
The text was updated successfully, but these errors were encountered: