all: gofmt -w -r 'interface{} -> any' .

Updates #9687
This commit is contained in:
Bjørn Erik Pedersen
2022-03-17 22:03:27 +01:00
parent 423594e03a
commit b80853de90
342 changed files with 2118 additions and 2102 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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)
}

View File

@@ -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)