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/highlight/config.go | |
parent | 423594e03a906ef4150f433666ff588b022c3c92 (diff) |
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'markup/highlight/config.go')
-rw-r--r-- | markup/highlight/config.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/markup/highlight/config.go b/markup/highlight/config.go index 1142c5e11..08c1bca1a 100644 --- a/markup/highlight/config.go +++ b/markup/highlight/config.go @@ -115,12 +115,12 @@ func (cfg Config) ToHTMLOptions() []html.Option { return options } -func applyOptions(opts interface{}, cfg *Config) error { +func applyOptions(opts any, cfg *Config) error { if opts == nil { return nil } switch vv := opts.(type) { - case map[string]interface{}: + case map[string]any: return applyOptionsFromMap(vv, cfg) default: s, err := cast.ToStringE(opts) @@ -139,7 +139,7 @@ func applyOptionsFromString(opts string, cfg *Config) error { return mapstructure.WeakDecode(optsm, cfg) } -func applyOptionsFromMap(optsm map[string]interface{}, cfg *Config) error { +func applyOptionsFromMap(optsm map[string]any, cfg *Config) error { normalizeHighlightOptions(optsm) return mapstructure.WeakDecode(optsm, cfg) } @@ -184,9 +184,9 @@ func ApplyLegacyConfig(cfg config.Provider, conf *Config) error { return nil } -func parseHightlightOptions(in string) (map[string]interface{}, error) { +func parseHightlightOptions(in string) (map[string]any, error) { in = strings.Trim(in, " ") - opts := make(map[string]interface{}) + opts := make(map[string]any) if in == "" { return opts, nil @@ -207,7 +207,7 @@ func parseHightlightOptions(in string) (map[string]interface{}, error) { return opts, nil } -func normalizeHighlightOptions(m map[string]interface{}) { +func normalizeHighlightOptions(m map[string]any) { if m == nil { return } |