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: Bump Go Version to 1.18 #1027

Merged
merged 3 commits into from Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1027.txt
@@ -0,0 +1,3 @@
```release-note:note
This Go module has been updated to Go 1.18 per the [Go support policy](https://golang.org/doc/devel/release.html#policy). Any consumers building on earlier Go versions may experience errors.
```
2 changes: 1 addition & 1 deletion .github/workflows/ci-go.yml
Expand Up @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.18', '1.17' ]
go-version: [ '1.19', '1.18' ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -18,7 +18,7 @@ When running provider tests, Terraform 0.12.26 or later is needed for version 2.

This project follows the [support policy](https://golang.org/doc/devel/release.html#policy) of Go as its support policy. The two latest major releases of Go are supported by the project.

Currently, that means Go **1.17** or later must be used when including this project as a dependency.
Currently, that means Go **1.18** or later must be used when including this project as a dependency.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform-plugin-sdk/v2

go 1.17
go 1.18

require (
github.com/apparentlymart/go-cidr v1.1.0
Expand Down
27 changes: 0 additions & 27 deletions go.sum

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions helper/schema/provider_go115_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions helper/schema/provider_prego115_test.go

This file was deleted.

2 changes: 2 additions & 0 deletions helper/schema/provider_test.go
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)

const invalidDurationErrMsg = "time: invalid duration \"invalid\""

func TestProviderGetSchema(t *testing.T) {
// This functionality is already broadly tested in core_schema_test.go,
// so this is just to ensure that the call passes through correctly.
Expand Down
35 changes: 18 additions & 17 deletions website/docs/plugin/sdkv2/testing/acceptance-tests/index.mdx
Expand Up @@ -136,7 +136,7 @@ Create a [GitHub Actions workflow](https://docs.github.com/en/actions/using-work

Use the [`matrix`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) strategy for more advanced configuration, such as running acceptance testing against multiple Terraform CLI versions.

The following example workflow runs acceptance testing for the provider using the latest patch versions of Go 1.17 and Terraform CLI 1.1:
The following example workflow runs acceptance testing for the provider using the latest patch versions of Go 1.18 and Terraform CLI 1.2:

```yaml
name: Terraform Provider Tests
Expand All @@ -156,13 +156,13 @@ jobs:
name: Acceptance Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: hashicorp/setup-terraform@v1
go-version: '1.18'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: '1.1.*'
terraform_version: '1.2.*'
terraform_wrapper: false
- run: go test -v -cover ./...
env:
Expand All @@ -171,15 +171,15 @@ jobs:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
- run: go test -v -cover ./...
```


The following example workflow runs acceptance testing for the provider using the latest patch versions of Go 1.17 and Terraform CLI 0.12 through 1.1:
The following example workflow runs acceptance testing for the provider using the latest patch versions of Go 1.18 and Terraform CLI 0.12 through 1.2:

```yaml
name: Terraform Provider Tests
Expand Down Expand Up @@ -208,12 +208,13 @@ jobs:
- '0.15.*'
- '1.0.*'
- '1.1.*'
- '1.2.*'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: hashicorp/setup-terraform@v1
go-version: '1.18'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform-version }}
terraform_wrapper: false
Expand All @@ -224,10 +225,10 @@ jobs:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
- run: go test -v -cover ./...
```

Expand Down