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

chore: use go 1.22 #11007

Merged
merged 16 commits into from
Feb 16, 2024
2 changes: 1 addition & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Default

env:
GO_VERSION: ^1.21
GO_VERSION: ^1.22

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy updated templates

env:
GO_VERSION: ^1.21
GO_VERSION: ^1.22

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Nightly Build

env:
GO_VERSION: ^1.21
GO_VERSION: ^1.22

on:
schedule: # runs on the default branch: master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release

env:
GO_VERSION: ^1.21
GO_VERSION: ^1.22

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy data to website

env:
GO_VERSION: ^1.21
GO_VERSION: ^1.22

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
go: "1.21"
go: "1.22"

issues:
exclude:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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/

Expand Down Expand Up @@ -135,5 +135,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/
2 changes: 1 addition & 1 deletion charger/versicharge.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (wb *Versicharge) CurrentPower() (float64, error) {
}

var sum float64
for i := 0; i < 3; i++ {
for i := range 3 {
andig marked this conversation as resolved.
Show resolved Hide resolved
sum += float64(binary.BigEndian.Uint16(b[2*i:]))
}

Expand Down
4 changes: 0 additions & 4 deletions cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()

Expand Down Expand Up @@ -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 {
Expand All @@ -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()

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
8 changes: 0 additions & 8 deletions util/goversion/constraint.go

This file was deleted.

5 changes: 0 additions & 5 deletions util/goversion/version.go

This file was deleted.

1 change: 1 addition & 0 deletions util/templates/render_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func TestClass(t *testing.T, class Class, instantiate func(t *testing.T, values
t.Parallel()

for _, tmpl := range ByClass(class) {
// TODO allow usage in parallel tests without shadowing
andig marked this conversation as resolved.
Show resolved Hide resolved
tmpl := tmpl

// set default values for all params
Expand Down
Loading