diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-17 22:03:27 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-17 22:03:27 +0100 |
commit | b80853de90b10171155b8f3fde47d64ec7bfa0dd (patch) | |
tree | 435d3dbf7a495a0c6ce64c9769e037179aa0d27b /tpl/data/data.go | |
parent | 423594e03a906ef4150f433666ff588b022c3c92 (diff) |
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'tpl/data/data.go')
-rw-r--r-- | tpl/data/data.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tpl/data/data.go b/tpl/data/data.go index cfd847474..5e03d52c3 100644 --- a/tpl/data/data.go +++ b/tpl/data/data.go @@ -63,7 +63,7 @@ type Namespace struct { // The data separator can be a comma, semi-colon, pipe, etc, but only one character. // If you provide multiple parts for the URL they will be joined together to the final URL. // GetCSV returns nil or a slice slice to use in a short code. -func (ns *Namespace) GetCSV(sep string, args ...interface{}) (d [][]string, err error) { +func (ns *Namespace) GetCSV(sep string, args ...any) (d [][]string, err error) { url, headers := toURLAndHeaders(args) cache := ns.cacheGetCSV @@ -102,8 +102,8 @@ func (ns *Namespace) GetCSV(sep string, args ...interface{}) (d [][]string, err // GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one. // If you provide multiple parts they will be joined together to the final URL. // GetJSON returns nil or parsed JSON to use in a short code. -func (ns *Namespace) GetJSON(args ...interface{}) (interface{}, error) { - var v interface{} +func (ns *Namespace) GetJSON(args ...any) (any, error) { + var v any url, headers := toURLAndHeaders(args) cache := ns.cacheGetJSON @@ -146,7 +146,7 @@ func addDefaultHeaders(req *http.Request, accepts ...string) { } } -func addUserProvidedHeaders(headers map[string]interface{}, req *http.Request) { +func addUserProvidedHeaders(headers map[string]any, req *http.Request) { if headers == nil { return } @@ -179,7 +179,7 @@ func hasHeaderKey(m http.Header, key string) bool { return ok } -func toURLAndHeaders(urlParts []interface{}) (string, map[string]interface{}) { +func toURLAndHeaders(urlParts []any) (string, map[string]any) { if len(urlParts) == 0 { return "", nil } |