diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1e81d0fa136..27ca7752677 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -44,7 +44,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - name: Cache Go id: go-cache uses: actions/cache@v3 @@ -108,7 +108,7 @@ jobs: unittest: strategy: matrix: - go-version: [1.19, 1.18, 1.17] + go-version: [1.19, 1.18] runs-on: ubuntu-latest needs: [setup-environment] steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index e44080cc930..549588002e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - `component.WithTracesProcessor` - `component.WithMetricsProcessor` - `component.WithLogsProcessor` +- Update minimum go version to 1.18 (#5795) ### 🚩 Deprecations 🚩 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de254728b59..dbd6f9712ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -144,7 +144,7 @@ section of general project contributing guide. Working with the project sources requires the following tools: 1. [git](https://git-scm.com/) -2. [go](https://golang.org/) (version 1.17 and up) +2. [go](https://golang.org/) (version 1.18 and up) 3. [make](https://www.gnu.org/software/make/) 4. [docker](https://www.docker.com/) @@ -205,7 +205,7 @@ before merging (but see above paragraph about writing good commit messages in th ## General Notes -This project uses Go 1.17.* and [Github Actions.](https://github.com/features/actions) +This project uses Go 1.18.* and [Github Actions.](https://github.com/features/actions) It is recommended to run `make gofmt all` before submitting your PR diff --git a/Makefile.Common b/Makefile.Common index a5aa1c7dbf8..daf1e14dc87 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -38,7 +38,7 @@ fmt: .PHONY: tidy tidy: rm -fr go.sum - $(GOCMD) mod tidy -compat=1.17 + $(GOCMD) mod tidy -compat=1.18 .PHONY: lint lint: diff --git a/cmd/builder/go.mod b/cmd/builder/go.mod index a7310b43892..d9ed8848d78 100644 --- a/cmd/builder/go.mod +++ b/cmd/builder/go.mod @@ -14,7 +14,7 @@ module go.opentelemetry.io/collector/cmd/builder -go 1.17 +go 1.18 require ( github.com/knadh/koanf v1.4.2 diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index 3b28cc727a1..9646fa36497 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -99,7 +99,7 @@ func Compile(cfg Config) error { // GetModules retrieves the go modules, updating go.mod and go.sum in the process func GetModules(cfg Config) error { // #nosec G204 - cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.17") + cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.18") cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("failed to update go.mod: %w. Output: %q", err, out) diff --git a/cmd/builder/internal/builder/templates/go.mod.tmpl b/cmd/builder/internal/builder/templates/go.mod.tmpl index 8fe6378765c..cf7da63559f 100644 --- a/cmd/builder/internal/builder/templates/go.mod.tmpl +++ b/cmd/builder/internal/builder/templates/go.mod.tmpl @@ -2,7 +2,7 @@ module {{.Distribution.Module}} -go 1.17 +go 1.18 require ( {{- range .Extensions}} diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index adaefb732ef..f353e409ca1 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -2,7 +2,7 @@ module go.opentelemetry.io/collector/cmd/otelcorecol -go 1.17 +go 1.18 require ( github.com/stretchr/testify v1.8.0 diff --git a/go.mod b/go.mod index dabe32c827f..3ccdf896efc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector -go 1.17 +go 1.18 require ( contrib.go.opencensus.io/exporter/prometheus v0.4.1 diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 86a43592e79..70c2ea95b83 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/internal/tools -go 1.17 +go 1.18 require ( github.com/client9/misspell v0.3.4 diff --git a/pdata/go.mod b/pdata/go.mod index ea08e0b9d08..552e11234f2 100644 --- a/pdata/go.mod +++ b/pdata/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/pdata -go 1.17 +go 1.18 require ( github.com/gogo/protobuf v1.3.2 diff --git a/semconv/go.mod b/semconv/go.mod index fff34dec0f7..3b14367e4c0 100644 --- a/semconv/go.mod +++ b/semconv/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/semconv -go 1.17 +go 1.18 require github.com/stretchr/testify v1.8.0