chore: use go 1.23 (#14647)
This commit is contained in:
parent
40b6d1b7f3
commit
0f511ce93f
17 changed files with 27 additions and 31 deletions
2
.github/workflows/default.yml
vendored
2
.github/workflows/default.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
name: Default
|
||||
|
||||
env:
|
||||
GO_VERSION: ^1.22
|
||||
GO_VERSION: ^1.23
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
|
|||
2
.github/workflows/documentation.yml
vendored
2
.github/workflows/documentation.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
name: Deploy updated templates
|
||||
|
||||
env:
|
||||
GO_VERSION: ^1.22
|
||||
GO_VERSION: ^1.23
|
||||
|
||||
on:
|
||||
schedule:
|
||||
|
|
|
|||
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
name: Nightly Build
|
||||
|
||||
env:
|
||||
GO_VERSION: ^1.22
|
||||
GO_VERSION: ^1.23
|
||||
|
||||
on:
|
||||
schedule: # runs on the default branch: master
|
||||
|
|
|
|||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
name: Release
|
||||
|
||||
env:
|
||||
GO_VERSION: ^1.22
|
||||
GO_VERSION: ^1.23
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
|
|||
2
.github/workflows/website.yml
vendored
2
.github/workflows/website.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
name: Deploy data to website
|
||||
|
||||
env:
|
||||
GO_VERSION: ^1.22
|
||||
GO_VERSION: ^1.23
|
||||
|
||||
on:
|
||||
release:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
run:
|
||||
go: "1.22"
|
||||
go: "1.23"
|
||||
|
||||
issues:
|
||||
exclude:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#### Development environment
|
||||
|
||||
Developing evcc requires [Go][1] 1.22 and [Node][2] 18. We recommend VSCode with the [Go](https://marketplace.visualstudio.com/items?itemName=golang.Go), [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) extensions.
|
||||
Developing evcc requires [Go][1] 1.23 and [Node][2] 18. We recommend VSCode with the [Go](https://marketplace.visualstudio.com/items?itemName=golang.Go), [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) extensions.
|
||||
|
||||
We use linters (golangci-lint, Prettier) to keep a coherent source code formatting. It's recommended to use the format-on-save feature of your editor. You can manually reformat your code by running:
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ RUN make ui
|
|||
|
||||
|
||||
# STEP 2 build executable binary
|
||||
FROM --platform=$BUILDPLATFORM golang:1.22-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine as builder
|
||||
|
||||
# Install git + SSL ca certificates.
|
||||
# Git is required for fetching the dependencies.
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
_ "embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"slices"
|
||||
"strconv"
|
||||
|
|
@ -18,7 +19,6 @@ import (
|
|||
"github.com/evcc-io/evcc/util/machine"
|
||||
"github.com/evcc-io/evcc/util/templates"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ func (c *CmdConfigure) Run(log *util.Logger, flagLang string, advancedMode, expa
|
|||
}
|
||||
}
|
||||
|
||||
log.FATAL.Fatalln("invalid category:", category, "have:", maps.Keys(DeviceCategories))
|
||||
log.FATAL.Fatalln("invalid category:", category, "have:", slices.Collect(maps.Keys(DeviceCategories)))
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/evcc-io/evcc
|
||||
|
||||
go 1.22.0
|
||||
go 1.23
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.0
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ package goodwe
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"maps"
|
||||
"net"
|
||||
"slices"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -66,7 +67,7 @@ func (m *Server) readData() {
|
|||
|
||||
for {
|
||||
mu.RLock()
|
||||
ips := maps.Keys(m.inverters)
|
||||
ips := slices.Collect(maps.Keys(m.inverters))
|
||||
mu.RUnlock()
|
||||
|
||||
for _, ip := range ips {
|
||||
|
|
|
|||
|
|
@ -55,8 +55,7 @@ func All() []setting {
|
|||
mu.RLock()
|
||||
defer mu.RUnlock()
|
||||
|
||||
res := slices.Clone(settings)
|
||||
slices.SortFunc(res, func(i, j setting) int {
|
||||
res := slices.SortedFunc(slices.Values(settings), func(i, j setting) int {
|
||||
return cmp.Compare(i.Key, j.Key)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -110,11 +110,7 @@ func ParseDays(s string) ([]Day, error) {
|
|||
return nil, errors.New("too many days")
|
||||
}
|
||||
|
||||
sorted := make([]Day, len(res))
|
||||
copy(sorted, res)
|
||||
slices.Sort(sorted)
|
||||
|
||||
if len(slices.Compact(sorted)) < len(res) {
|
||||
if len(slices.Compact(slices.Sorted(slices.Values(res)))) < len(res) {
|
||||
return nil, errors.New("duplicate days")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ package util
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"sync"
|
||||
|
||||
"github.com/evcc-io/evcc/util/encode"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
// Cache is a data store
|
||||
|
|
@ -89,7 +90,7 @@ func (c *Cache) All() []Param {
|
|||
c.mu.RLock()
|
||||
defer c.mu.RUnlock()
|
||||
|
||||
return maps.Values(c.val)
|
||||
return slices.Collect(maps.Values(c.val))
|
||||
}
|
||||
|
||||
// Add entry to cache
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"maps"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-sprout/sprout"
|
||||
"github.com/samber/lo"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
var re = regexp.MustCompile(`(?i)\${(\w+)(:([a-zA-Z0-9%.]+))?}`)
|
||||
|
|
@ -96,7 +97,7 @@ func ReplaceFormatted(s string, kv map[string]interface{}) (string, error) {
|
|||
|
||||
// return missing keys
|
||||
if len(wanted) > 0 {
|
||||
return "", fmt.Errorf("wanted: %v, got: %v", wanted, maps.Keys(kv))
|
||||
return "", fmt.Errorf("wanted: %v, got: %v", slices.Sorted(slices.Values(wanted)), slices.Sorted(maps.Keys(kv)))
|
||||
}
|
||||
|
||||
return s, nil
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ package logstash
|
|||
import (
|
||||
"container/ring"
|
||||
"io"
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
var DefaultHandler = New(10000)
|
||||
|
|
@ -91,9 +91,7 @@ func (l *logger) Areas() []string {
|
|||
}
|
||||
}
|
||||
|
||||
keys := maps.Keys(areas)
|
||||
slices.Sort(keys)
|
||||
return keys
|
||||
return slices.Sorted(maps.Keys(areas))
|
||||
}
|
||||
|
||||
func (l *logger) All(areas []string, level jww.Threshold, count int) []string {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package registry
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/exp/maps"
|
||||
"maps"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
@ -38,7 +38,7 @@ func (r registry[T]) Get(name string) (factoryFunc[T], error) {
|
|||
}
|
||||
|
||||
func (r registry[T]) Types() []string {
|
||||
return maps.Keys(r.data)
|
||||
return slices.Collect(maps.Keys(r.data))
|
||||
}
|
||||
|
||||
func New[T any](typ string) registry[T] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue