Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Provide a shortcut function to get Name in Semantic mode #366

Open
@vmarkovtsev

Description

Having obtained function names in #365 I need to get the actual strings. My current take is

nodeName, err := tools.FilterNode(node, "//uast:Function/../../Name")
if err != nil {
	return nil, err
}
println(string(nodeName.(nodes.Object)["Name"].(nodes.String)))

I have to hardcode "Name" and do two type assertions. Is it possible to add a wrapper?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions