summaryrefslogtreecommitdiffstats
path: root/markup/goldmark
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-17 22:03:27 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-17 22:03:27 +0100
commitb80853de90b10171155b8f3fde47d64ec7bfa0dd (patch)
tree435d3dbf7a495a0c6ce64c9769e037179aa0d27b /markup/goldmark
parent423594e03a906ef4150f433666ff588b022c3c92 (diff)
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'markup/goldmark')
-rw-r--r--markup/goldmark/codeblocks/render.go4
-rw-r--r--markup/goldmark/convert_test.go6
-rw-r--r--markup/goldmark/render_hooks.go10
-rw-r--r--markup/goldmark/toc_test.go2
4 files changed, 11 insertions, 11 deletions
diff --git a/markup/goldmark/codeblocks/render.go b/markup/goldmark/codeblocks/render.go
index 97604eb55..fa6d236a1 100644
--- a/markup/goldmark/codeblocks/render.go
+++ b/markup/goldmark/codeblocks/render.go
@@ -132,7 +132,7 @@ func (r *htmlRenderer) renderCodeBlock(w util.BufWriter, src []byte, node ast.No
}
type codeBlockContext struct {
- page interface{}
+ page any
lang string
code string
ordinal int
@@ -146,7 +146,7 @@ type codeBlockContext struct {
*attributes.AttributesHolder
}
-func (c *codeBlockContext) Page() interface{} {
+func (c *codeBlockContext) Page() any {
return c.page
}
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go
index 83d97f222..e37e81c97 100644
--- a/markup/goldmark/convert_test.go
+++ b/markup/goldmark/convert_test.go
@@ -44,7 +44,7 @@ func convert(c *qt.C, mconf markup_config.Config, content string) converter.Resu
c.Assert(err, qt.IsNil)
h := highlight.New(mconf.Highlight)
- getRenderer := func(t hooks.RendererType, id interface{}) interface{} {
+ getRenderer := func(t hooks.RendererType, id any) any {
if t == hooks.CodeBlockRendererType {
return h
}
@@ -233,7 +233,7 @@ func TestConvertAttributes(t *testing.T) {
name string
withConfig func(conf *markup_config.Config)
input string
- expect interface{}
+ expect any
}{
{
"Title",
@@ -408,7 +408,7 @@ LINE5
h := highlight.New(conf)
- getRenderer := func(t hooks.RendererType, id interface{}) interface{} {
+ getRenderer := func(t hooks.RendererType, id any) any {
if t == hooks.CodeBlockRendererType {
return h
}
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index 6aafc70e1..e28f816d6 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -47,7 +47,7 @@ func newLinks(cfg goldmark_config.Config) goldmark.Extender {
}
type linkContext struct {
- page interface{}
+ page any
destination string
title string
text hstring.RenderedString
@@ -62,7 +62,7 @@ func (ctx linkContext) Resolved() bool {
return false
}
-func (ctx linkContext) Page() interface{} {
+func (ctx linkContext) Page() any {
return ctx.page
}
@@ -79,7 +79,7 @@ func (ctx linkContext) Title() string {
}
type headingContext struct {
- page interface{}
+ page any
level int
anchor string
text hstring.RenderedString
@@ -87,7 +87,7 @@ type headingContext struct {
*attributes.AttributesHolder
}
-func (ctx headingContext) Page() interface{} {
+func (ctx headingContext) Page() any {
return ctx.page
}
@@ -112,7 +112,7 @@ type hookedRenderer struct {
html.Config
}
-func (r *hookedRenderer) SetOption(name renderer.OptionName, value interface{}) {
+func (r *hookedRenderer) SetOption(name renderer.OptionName, value any) {
r.Config.SetOption(name, value)
}
diff --git a/markup/goldmark/toc_test.go b/markup/goldmark/toc_test.go
index 6e080bf46..947f58a36 100644
--- a/markup/goldmark/toc_test.go
+++ b/markup/goldmark/toc_test.go
@@ -28,7 +28,7 @@ import (
qt "github.com/frankban/quicktest"
)
-var nopGetRenderer = func(t hooks.RendererType, id interface{}) interface{} { return nil }
+var nopGetRenderer = func(t hooks.RendererType, id any) any { return nil }
func TestToc(t *testing.T) {
c := qt.New(t)