Skip to content

Var("name").Text() prints function/struct body with both braces #391

@DmitriyMV

Description

@DmitriyMV

Repro:

package gorules

import "github.com/quasilyte/go-ruleguard/dsl"

func reproCapture(m dsl.Matcher) {
	m.Match(`type $t struct { $*body }`).
		Do(printRepro)
}

func printRepro(context *dsl.DoContext) {
	text := context.Var("body").Text()
	context.SetReport(text)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions