* replace interface{} with any
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-07-05 09:46:50 +03:00
коммит произвёл GitHub
родитель b45ff0be5d
Коммит 717a4d04a9
258 изменённых файлов: 1286 добавлений и 1286 удалений

Просмотреть файл

@@ -5,7 +5,7 @@ package markdown
// Inspect traverses the markdown tree in depth-first order. If f returns true, Inspect invokes f
// recursively for each child of the block or inline, followed by a call of f(nil).
func Inspect(markdown string, f func(interface{}) bool) {
func Inspect(markdown string, f func(any) bool) {
document, referenceDefinitions := Parse(markdown)
InspectBlock(document, func(block Block) bool {
if !f(block) {

Просмотреть файл

@@ -22,7 +22,7 @@ func TestInspect(t *testing.T) {
visited := []string{}
level := 0
Inspect(markdown, func(blockOrInline interface{}) bool {
Inspect(markdown, func(blockOrInline any) bool {
if blockOrInline == nil {
level--
} else {
@@ -67,7 +67,7 @@ Some bold text **Text for markdown?** to go with it.
At the end, some more lines`
for i := 0; i < b.N; i++ {
Inspect(text, func(_ interface{}) bool {
Inspect(text, func(_ any) bool {
counterSink++
return true
})

Просмотреть файл

@@ -99,7 +99,7 @@ func TestTextRanges(t *testing.T) {
t.Run(name, func(t *testing.T) {
var ranges []Range
var values []string
Inspect(tc.Markdown, func(node interface{}) bool {
Inspect(tc.Markdown, func(node any) bool {
if textNode, ok := node.(*Text); ok {
ranges = append(ranges, textNode.Range)
values = append(values, textNode.Text)