chore: upgrade to Go 1.20 (#5993)
This commit is contained in:
parent
e6f8939ee7
commit
60ebd9e585
13 changed files with 589 additions and 144 deletions
10
.github/workflows/default.yml
vendored
10
.github/workflows/default.yml
vendored
|
|
@ -17,7 +17,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
|
|||
2
.github/workflows/documentation.yml
vendored
2
.github/workflows/documentation.yml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
|
|||
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
|
|
@ -81,7 +81,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
|
|||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -60,7 +60,7 @@ jobs:
|
|||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
|
|||
2
.github/workflows/website.yml
vendored
2
.github/workflows/website.yml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ^1.18
|
||||
go-version: ^1.20
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
run:
|
||||
go: 1.18
|
||||
go: 1.20
|
||||
issues:
|
||||
exclude:
|
||||
- .regActualCurrent. is unused
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ RUN make ui
|
|||
|
||||
|
||||
# STEP 2 build executable binary
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder
|
||||
|
||||
# Install git + SSL ca certificates.
|
||||
# Git is required for fetching the dependencies.
|
||||
|
|
@ -66,7 +66,7 @@ RUN RELEASE=${RELEASE} GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
|
|||
|
||||
|
||||
# STEP 3 build a small image including module support
|
||||
FROM alpine:3.15
|
||||
FROM alpine:3.17
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ You'll find everything you need in our [documentation](https://docs.evcc.io/) (G
|
|||
|
||||
## Contribute
|
||||
|
||||
To build evcc from source, [Go][1] 1.18 and [Node][2] 18 are required.
|
||||
To build evcc from source, [Go][1] 1.20 and [Node][2] 18 are required.
|
||||
|
||||
Build and run go backend. The UI becomes available at http://127.0.0.1:7070/
|
||||
|
||||
|
|
|
|||
52
go.mod
52
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/evcc-io/evcc
|
||||
|
||||
go 1.18
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/AlecAivazis/survey/v2 v2.3.6
|
||||
|
|
@ -11,7 +11,7 @@ require (
|
|||
github.com/andig/mbserver v0.0.0-20221101171752-364e71b0089c
|
||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
|
||||
github.com/avast/retry-go/v3 v3.1.1
|
||||
github.com/aws/aws-sdk-go v1.44.185
|
||||
github.com/aws/aws-sdk-go v1.44.198
|
||||
github.com/basgys/goxml2json v1.1.0
|
||||
github.com/basvdlei/gotsmart v0.0.3
|
||||
github.com/benbjohnson/clock v1.3.0
|
||||
|
|
@ -19,7 +19,7 @@ require (
|
|||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/cjrd/allocate v0.0.0-20220510215731-986f24f0fb18
|
||||
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
|
||||
github.com/containrrr/shoutrrr v0.6.1
|
||||
github.com/containrrr/shoutrrr v0.7.1
|
||||
github.com/coreos/go-oidc/v3 v3.5.0
|
||||
github.com/deepmap/oapi-codegen v1.12.4
|
||||
github.com/denisbrodbeck/machineid v1.0.1
|
||||
|
|
@ -35,7 +35,7 @@ require (
|
|||
github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1
|
||||
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
|
||||
github.com/godbus/dbus/v5 v5.1.0
|
||||
github.com/gokrazy/updater v0.0.0-20211121155532-30ae8cd650ea
|
||||
github.com/gokrazy/updater v0.0.0-20230206220435-64f39da38fa6
|
||||
github.com/golang-module/carbon/v2 v2.2.3
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/google/go-github/v32 v32.1.0
|
||||
|
|
@ -48,12 +48,12 @@ require (
|
|||
github.com/hashicorp/go-version v1.6.0
|
||||
github.com/hasura/go-graphql-client v0.8.2-0.20230118111322-12655772463c
|
||||
github.com/imdario/mergo v0.3.13
|
||||
github.com/influxdata/influxdb-client-go/v2 v2.12.1
|
||||
github.com/influxdata/influxdb-client-go/v2 v2.12.2
|
||||
github.com/itchyny/gojq v0.12.11
|
||||
github.com/jeremywohl/flatten v1.0.1
|
||||
github.com/jinzhu/copier v0.3.5
|
||||
github.com/joeshaw/carwings v0.0.0-20220711204617-d90801cf2848
|
||||
github.com/joho/godotenv v1.4.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/jpfielding/go-http-digest v0.0.0-20211006141426-fbc93758452e
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||
github.com/koron/go-ssdp v0.0.3
|
||||
|
|
@ -90,20 +90,20 @@ require (
|
|||
github.com/volkszaehler/mbmd v0.0.0-20230202102845-c58e07a6f048
|
||||
github.com/writeas/go-strip-markdown v2.0.1+incompatible
|
||||
gitlab.com/bboehmke/sunny v0.15.1-0.20211022160056-2fba1c86ade6
|
||||
golang.org/x/exp v0.0.0-20230118134722-a68e582fa157
|
||||
golang.org/x/net v0.5.0
|
||||
golang.org/x/oauth2 v0.4.0
|
||||
golang.org/x/exp v0.0.0-20230206171751-46f607a40771
|
||||
golang.org/x/net v0.6.0
|
||||
golang.org/x/oauth2 v0.5.0
|
||||
golang.org/x/sync v0.1.0
|
||||
golang.org/x/text v0.6.0
|
||||
google.golang.org/api v0.108.0
|
||||
google.golang.org/grpc v1.52.0
|
||||
golang.org/x/text v0.7.0
|
||||
google.golang.org/api v0.109.0
|
||||
google.golang.org/grpc v1.53.0
|
||||
google.golang.org/protobuf v1.28.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
gorm.io/gorm v1.24.3
|
||||
gorm.io/gorm v1.24.5
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute v1.15.1 // indirect
|
||||
cloud.google.com/go/compute v1.18.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver/v3 v3.2.0 // indirect
|
||||
|
|
@ -119,18 +119,18 @@ require (
|
|||
github.com/fatih/color v1.14.1 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/glebarez/go-sqlite v1.20.0 // indirect
|
||||
github.com/glebarez/go-sqlite v1.20.3 // indirect
|
||||
github.com/go-http-utils/fresh v0.0.0-20161124030543-7231e26a4b27 // indirect
|
||||
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a // indirect
|
||||
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
|
||||
github.com/go-kit/log v0.2.1 // indirect
|
||||
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
||||
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.2.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
|
||||
github.com/grid-x/serial v0.0.0-20211107191517-583c7356b3aa // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
|
|
@ -163,7 +163,7 @@ require (
|
|||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20220927061507-ef77025ab5aa // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rickb777/date v1.20.1 // indirect
|
||||
github.com/rickb777/plural v1.4.1 // indirect
|
||||
github.com/rivo/uniseg v0.4.3 // indirect
|
||||
|
|
@ -178,20 +178,20 @@ require (
|
|||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
gitlab.com/c0b/go-ordered-json v0.0.0-20201030195603-febf46534d5a // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
golang.org/x/crypto v0.5.0 // indirect
|
||||
golang.org/x/mod v0.7.0 // indirect
|
||||
golang.org/x/sys v0.4.0 // indirect
|
||||
golang.org/x/term v0.4.0 // indirect
|
||||
golang.org/x/tools v0.5.0 // indirect
|
||||
golang.org/x/crypto v0.6.0 // indirect
|
||||
golang.org/x/mod v0.8.0 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
golang.org/x/term v0.5.0 // indirect
|
||||
golang.org/x/tools v0.6.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
|
||||
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/sourcemap.v1 v1.0.5 // indirect
|
||||
modernc.org/libc v1.22.2 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.5.0 // indirect
|
||||
modernc.org/sqlite v1.20.3 // indirect
|
||||
modernc.org/sqlite v1.20.4 // indirect
|
||||
nhooyr.io/websocket v1.8.7 // indirect
|
||||
)
|
||||
|
||||
|
|
|
|||
5
main.go
5
main.go
|
|
@ -5,8 +5,6 @@ import (
|
|||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/evcc-io/evcc/cmd"
|
||||
"github.com/evcc-io/evcc/server/assets"
|
||||
|
|
@ -23,9 +21,6 @@ var (
|
|||
|
||||
// init loads embedded assets unless live assets are already loaded
|
||||
func init() {
|
||||
// TODO remove this once Go 1.20 is out with it.
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
if !assets.Live() {
|
||||
var err error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// 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.18.
|
||||
// will only compile if the Go runtime version is >= 1.20.
|
||||
package goversion
|
||||
|
||||
// This will fail to compile if the Go runtime version isn't >= 1.18.
|
||||
var _ = __EVCC_REQUIRES_GO_VERSION_1_18__
|
||||
// This will fail to compile if the Go runtime version isn't >= 1.20.
|
||||
var _ = __EVCC_REQUIRES_GO_VERSION_1_20__
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//go:build go1.18
|
||||
//go:build go1.20
|
||||
|
||||
package goversion
|
||||
|
||||
const __EVCC_REQUIRES_GO_VERSION_1_18__ = uint8(0)
|
||||
const __EVCC_REQUIRES_GO_VERSION_1_20__ = uint8(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue