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 /markup/internal | |
parent | 423594e03a906ef4150f433666ff588b022c3c92 (diff) |
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'markup/internal')
-rw-r--r-- | markup/internal/attributes/attributes.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/markup/internal/attributes/attributes.go b/markup/internal/attributes/attributes.go index a20690c4c..edf857822 100644 --- a/markup/internal/attributes/attributes.go +++ b/markup/internal/attributes/attributes.go @@ -64,11 +64,11 @@ func New(astAttributes []ast.Attribute, ownerType AttributesOwnerType) *Attribut if strings.HasPrefix(string(nameLower), "on") { continue } - var vv interface{} + var vv any switch vvv := v.Value.(type) { case bool, float64: vv = vvv - case []interface{}: + case []any: // Highlight line number hlRanges. var hlRanges [][2]int for _, l := range vvv { @@ -118,7 +118,7 @@ func New(astAttributes []ast.Attribute, ownerType AttributesOwnerType) *Attribut type Attribute struct { Name string - Value interface{} + Value any } func (a Attribute) ValueString() string { @@ -134,16 +134,16 @@ type AttributesHolder struct { // What we send to the the render hooks. attributesMapInit sync.Once - attributesMap map[string]interface{} + attributesMap map[string]any optionsMapInit sync.Once - optionsMap map[string]interface{} + optionsMap map[string]any } -type Attributes map[string]interface{} +type Attributes map[string]any -func (a *AttributesHolder) Attributes() map[string]interface{} { +func (a *AttributesHolder) Attributes() map[string]any { a.attributesMapInit.Do(func() { - a.attributesMap = make(map[string]interface{}) + a.attributesMap = make(map[string]any) for _, v := range a.attributes { a.attributesMap[v.Name] = v.Value } @@ -151,9 +151,9 @@ func (a *AttributesHolder) Attributes() map[string]interface{} { return a.attributesMap } -func (a *AttributesHolder) Options() map[string]interface{} { +func (a *AttributesHolder) Options() map[string]any { a.optionsMapInit.Do(func() { - a.optionsMap = make(map[string]interface{}) + a.optionsMap = make(map[string]any) for _, v := range a.options { a.optionsMap[v.Name] = v.Value } |