chore: upgrade tools (#26220)

This commit is contained in:
andig 2025-12-28 11:06:45 +01:00 • committed by GitHub
parent b18c36c0c0
commit 8d71350768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 16 additions and 22 deletions

View file

@ -21,6 +21,9 @@ linters:
- wastedassign
- whitespace
settings:
modernize:
disable:
- stringsbuilder
staticcheck:
checks:
- -SA1019

View file

@ -53,10 +53,10 @@ docs::
lint::
golangci-lint run
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.20.0 -test -category "-omitzero" -c 0 ./...
go tool modernize -test -c 0 -stringsbuilder=false -omitzero=false ./...
modernize:
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.20.0 -test -category "-omitzero" -fix ./...
go tool modernize -test -fix -stringsbuilder=false -omitzero=false ./...
lint-ui::
npm run lint

View file

@ -1,10 +0,0 @@
package store
// Provider creates a Persister for given string key
type Provider func(string) Store
// Store can load and store data
type Store interface {
Load(any) error
Save(any) error
}

2
go.mod
View file

@ -243,6 +243,7 @@ require (
golang.org/x/mod v0.31.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/tools/gopls v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect
@ -260,6 +261,7 @@ tool (
github.com/evcc-io/openapi-mcp/cmd/openapi-mcp
github.com/gokrazy/tools/cmd/gok
go.uber.org/mock/mockgen
golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize
)
replace github.com/grid-x/modbus => github.com/evcc-io/modbus v0.0.0-20250501165638-8b6f1fbdb7ea

2
go.sum
View file

@ -995,6 +995,8 @@ golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
golang.org/x/tools/gopls v0.21.0 h1:k8RlBm3ES+GVe+fbTSkzwKgarmNwN+6aDalb0T0xfag=
golang.org/x/tools/gopls v0.21.0/go.mod h1:x/34IonzHuKpDDlMUjYezcjbwNOJ32FtrYOLqAuOmNo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View file

@ -147,7 +147,7 @@ func dropNoCache(resp *http.Response, header string) {
if h := resp.Header.Get(header); h != "" {
var hh []string
for _, h := range strings.Split(h, ",") {
for h := range strings.SplitSeq(h, ",") {
if s := strings.TrimSpace(h); strings.ToLower(s) != "no-cache" {
hh = append(hh, s)
}

View file

@ -20,7 +20,7 @@ func init() {
}
// NewSubaruFromConfig creates a new vehicle
func NewSubaruFromConfig(other map[string]interface{}) (api.Vehicle, error) {
func NewSubaruFromConfig(other map[string]any) (api.Vehicle, error) {
cc := struct {
embed `mapstructure:",squash"`
User, Password, VIN string

View file

@ -2,6 +2,7 @@ package subaru
import (
"fmt"
"maps"
"net/http"
"net/url"
"strings"
@ -113,9 +114,7 @@ func (v *Identity) fetchTokenCredentials(code string) error {
}
headers := make(map[string]string)
for k, v := range request.URLEncoding {
headers[k] = v
}
maps.Copy(headers, request.URLEncoding)
headers["Authorization"] = AppAuthorization
req, err := request.New(http.MethodPost, uri, strings.NewReader(data.Encode()), headers)
if err != nil {
@ -163,9 +162,7 @@ func (v *Identity) refreshToken(token *oauth2.Token) (*oauth2.Token, error) {
}
headers := make(map[string]string)
for k, v := range request.URLEncoding {
headers[k] = v
}
maps.Copy(headers, request.URLEncoding)
headers["Authorization"] = AppAuthorization
var res oauth2.Token
req, err := request.New(http.MethodPost, uri, strings.NewReader(data.Encode()), headers)

View file

@ -41,7 +41,7 @@ type AuthCallback struct {
type AuthCallbackValue struct {
Name string `json:"name"`
Value interface{} `json:"value"`
Value any `json:"value"`
}
type Token struct {