build: modernize Go code with go fix for go1.25

This commit is contained in:
Nick Craig-Wood
2026-02-18 12:11:52 +00:00
parent cf97f250df
commit b2866f0291
36 changed files with 118 additions and 176 deletions
+2 -2
View File
@@ -163,7 +163,7 @@ func (f *Fs) refreshJWTToken(ctx context.Context) (string, error) {
if err != nil {
return "", fmt.Errorf("invalid token received from server")
}
var claims map[string]interface{}
var claims map[string]any
if err := json.Unmarshal(payload, &claims); err != nil {
return "", err
}
@@ -182,7 +182,7 @@ func (f *Fs) refreshJWTToken(ctx context.Context) (string, error) {
return f.token, nil
}
func (f *Fs) callAPI(ctx context.Context, method, path string, response interface{}) (*http.Response, error) {
func (f *Fs) callAPI(ctx context.Context, method, path string, response any) (*http.Response, error) {
token, err := f.refreshJWTToken(ctx)
if err != nil {
return nil, err
+2 -3
View File
@@ -7,6 +7,7 @@ import (
"context"
"fmt"
"io"
"maps"
"net/http"
"net/url"
"path"
@@ -203,9 +204,7 @@ func (s *shadeChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, read
var uploadRes *http.Response
if len(partURL.Headers) > 0 {
opts.ExtraHeaders = make(map[string]string)
for k, v := range partURL.Headers {
opts.ExtraHeaders[k] = v
}
maps.Copy(opts.ExtraHeaders, partURL.Headers)
}
err = s.f.pacer.Call(func() (bool, error) {