Skip to content
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

all: Update Go Module to Go 1.20 and remove go-multierror direct dependency #181

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Sep 6, 2023

Reference: https://pkg.go.dev/errors#Join
Reference: https://pkg.go.dev/math/rand#Seed
Closes #99
Closes #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

…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 bflad added enhancement New feature or request dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Sep 6, 2023
@bflad bflad added this to the v1.6.0 milestone Sep 6, 2023
@bflad bflad requested a review from a team as a code owner September 6, 2023 12:10
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚀

@bflad bflad merged commit f5d6460 into main Sep 6, 2023
5 checks passed
@bflad bflad deleted the bflad/go120upgrade branch September 6, 2023 17:13
@github-actions
Copy link

github-actions bot commented Oct 7, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Go Module to Go 1.20 Minimum Remove github.com/hashicorp/go-multierror Direct Dependency
2 participants