chore: upgrade tools (#26220)
This commit is contained in:
parent
b18c36c0c0
commit
8d71350768
9 changed files with 16 additions and 22 deletions
|
|
@ -21,6 +21,9 @@ linters:
|
||||||
- wastedassign
|
- wastedassign
|
||||||
- whitespace
|
- whitespace
|
||||||
settings:
|
settings:
|
||||||
|
modernize:
|
||||||
|
disable:
|
||||||
|
- stringsbuilder
|
||||||
staticcheck:
|
staticcheck:
|
||||||
checks:
|
checks:
|
||||||
- -SA1019
|
- -SA1019
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -53,10 +53,10 @@ docs::
|
||||||
|
|
||||||
lint::
|
lint::
|
||||||
golangci-lint run
|
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:
|
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::
|
lint-ui::
|
||||||
npm run lint
|
npm run lint
|
||||||
|
|
|
||||||
|
|
@ -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
2
go.mod
|
|
@ -243,6 +243,7 @@ require (
|
||||||
golang.org/x/mod v0.31.0 // indirect
|
golang.org/x/mod v0.31.0 // indirect
|
||||||
golang.org/x/sys v0.39.0 // indirect
|
golang.org/x/sys v0.39.0 // indirect
|
||||||
golang.org/x/term v0.38.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
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
|
||||||
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
|
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
|
||||||
gopkg.in/sourcemap.v1 v1.0.5 // 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/evcc-io/openapi-mcp/cmd/openapi-mcp
|
||||||
github.com/gokrazy/tools/cmd/gok
|
github.com/gokrazy/tools/cmd/gok
|
||||||
go.uber.org/mock/mockgen
|
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
|
replace github.com/grid-x/modbus => github.com/evcc-io/modbus v0.0.0-20250501165638-8b6f1fbdb7ea
|
||||||
|
|
|
||||||
2
go.sum
2
go.sum
|
|
@ -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.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 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
|
||||||
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
|
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-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-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ func dropNoCache(resp *http.Response, header string) {
|
||||||
if h := resp.Header.Get(header); h != "" {
|
if h := resp.Header.Get(header); h != "" {
|
||||||
var hh []string
|
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" {
|
if s := strings.TrimSpace(h); strings.ToLower(s) != "no-cache" {
|
||||||
hh = append(hh, s)
|
hh = append(hh, s)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSubaruFromConfig creates a new vehicle
|
// 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 {
|
cc := struct {
|
||||||
embed `mapstructure:",squash"`
|
embed `mapstructure:",squash"`
|
||||||
User, Password, VIN string
|
User, Password, VIN string
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package subaru
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -113,9 +114,7 @@ func (v *Identity) fetchTokenCredentials(code string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
headers := make(map[string]string)
|
headers := make(map[string]string)
|
||||||
for k, v := range request.URLEncoding {
|
maps.Copy(headers, request.URLEncoding)
|
||||||
headers[k] = v
|
|
||||||
}
|
|
||||||
headers["Authorization"] = AppAuthorization
|
headers["Authorization"] = AppAuthorization
|
||||||
req, err := request.New(http.MethodPost, uri, strings.NewReader(data.Encode()), headers)
|
req, err := request.New(http.MethodPost, uri, strings.NewReader(data.Encode()), headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -163,9 +162,7 @@ func (v *Identity) refreshToken(token *oauth2.Token) (*oauth2.Token, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
headers := make(map[string]string)
|
headers := make(map[string]string)
|
||||||
for k, v := range request.URLEncoding {
|
maps.Copy(headers, request.URLEncoding)
|
||||||
headers[k] = v
|
|
||||||
}
|
|
||||||
headers["Authorization"] = AppAuthorization
|
headers["Authorization"] = AppAuthorization
|
||||||
var res oauth2.Token
|
var res oauth2.Token
|
||||||
req, err := request.New(http.MethodPost, uri, strings.NewReader(data.Encode()), headers)
|
req, err := request.New(http.MethodPost, uri, strings.NewReader(data.Encode()), headers)
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ type AuthCallback struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthCallbackValue struct {
|
type AuthCallbackValue struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Value interface{} `json:"value"`
|
Value any `json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Token struct {
|
type Token struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue