From ce29ae58a17b8140a47aaab9a3c9c95b6568707a Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 16 Feb 2024 15:49:38 +0100 Subject: [PATCH] chore: use go 1.22 (#11007) --- .github/workflows/default.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/website.yml | 2 +- .golangci.yml | 2 +- Dockerfile | 2 +- README.md | 4 ++-- cmd/setup.go | 4 ---- go.mod | 4 +--- main.go | 1 - util/goversion/constraint.go | 8 -------- util/goversion/version.go | 5 ----- 13 files changed, 10 insertions(+), 30 deletions(-) delete mode 100644 util/goversion/constraint.go delete mode 100644 util/goversion/version.go diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index e631e1078..ad1e40450 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -1,7 +1,7 @@ name: Default env: - GO_VERSION: ^1.21 + GO_VERSION: ^1.22 on: push: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b59d70c77..ecfa74153 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,7 +1,7 @@ name: Deploy updated templates env: - GO_VERSION: ^1.21 + GO_VERSION: ^1.22 on: push: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index efb49844d..2204104f4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,7 +1,7 @@ name: Nightly Build env: - GO_VERSION: ^1.21 + GO_VERSION: ^1.22 on: schedule: # runs on the default branch: master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a81f965b3..532e47bb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release env: - GO_VERSION: ^1.21 + GO_VERSION: ^1.22 on: push: diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 87ab8ad40..aee95ecf1 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -1,7 +1,7 @@ name: Deploy data to website env: - GO_VERSION: ^1.21 + GO_VERSION: ^1.22 on: push: diff --git a/.golangci.yml b/.golangci.yml index fc1095a9e..6369a2f2d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - go: "1.21" + go: "1.22" issues: exclude: diff --git a/Dockerfile b/Dockerfile index 6715c006d..8f845e875 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN make ui # STEP 2 build executable binary -FROM --platform=$BUILDPLATFORM golang:1.21-alpine as builder +FROM --platform=$BUILDPLATFORM golang:1.22-alpine as builder # Install git + SSL ca certificates. # Git is required for fetching the dependencies. diff --git a/README.md b/README.md index c74306803..ce434c304 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ You'll find everything you need in our [documentation](https://docs.evcc.io/). ## Contribute -To build evcc from source, [Go][1] 1.21 and [Node][2] 18 are required. +To build evcc from source, [Go][1] 1.22 and [Node][2] 18 are required. Build and run go backend. The UI becomes available at http://127.0.0.1:7070/ @@ -134,5 +134,5 @@ While evcc is open source, we would also like to encourage vendors to provide op The personal sponsor token requires a [Github Sponsorship](https://github.com/sponsors/evcc-io) and can be requested at [sponsor.evcc.io](https://sponsor.evcc.io/). -[1]: https://golang.org +[1]: https://go.dev [2]: https://nodejs.org/ diff --git a/cmd/setup.go b/cmd/setup.go index 74a28f1a7..407e9bb4d 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -235,7 +235,6 @@ func configureChargers(static []config.Named, names ...string) error { continue } - cc := cc g.Go(func() error { instance, err := charger.NewFromConfig(cc.Type, cc.Other) if err != nil { @@ -253,7 +252,6 @@ func configureChargers(static []config.Named, names ...string) error { } for _, conf := range configurable { - conf := conf g.Go(func() error { cc := conf.Named() @@ -315,7 +313,6 @@ func configureVehicles(static []config.Named, names ...string) error { continue } - cc := cc g.Go(func() error { instance, err := vehicleInstance(cc) if err != nil { @@ -340,7 +337,6 @@ func configureVehicles(static []config.Named, names ...string) error { devs2 := make([]config.ConfigurableDevice[api.Vehicle], 0, len(configurable)) for _, conf := range configurable { - conf := conf g.Go(func() error { cc := conf.Named() diff --git a/go.mod b/go.mod index 8621d5aa1..eb12609ec 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/evcc-io/evcc -go 1.21.1 - -toolchain go1.21.3 +go 1.22.0 require ( dario.cat/mergo v1.0.0 diff --git a/main.go b/main.go index bd47ce9ca..490059727 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,6 @@ import ( "github.com/evcc-io/evcc/cmd" "github.com/evcc-io/evcc/server/assets" - _ "github.com/evcc-io/evcc/util/goversion" // require minimum go version _ "golang.org/x/crypto/x509roots/fallback" // fallback certificates ) diff --git a/util/goversion/constraint.go b/util/goversion/constraint.go deleted file mode 100644 index c3192c94a..000000000 --- a/util/goversion/constraint.go +++ /dev/null @@ -1,8 +0,0 @@ -// Approach from https://github.com/theckman/goconstraint/ - -// Package goversion should only be used as a blank import. If imported, it -// will only compile if the Go runtime version is >= 1.21. -package goversion - -// This will fail to compile if the Go runtime version isn't >= 1.21. -var _ = __EVCC_REQUIRES_GO_VERSION_1_21__ diff --git a/util/goversion/version.go b/util/goversion/version.go deleted file mode 100644 index 7e9b00228..000000000 --- a/util/goversion/version.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build go1.21 - -package goversion - -const __EVCC_REQUIRES_GO_VERSION_1_21__ = uint8(0)