CodeQL library for Go
codeql/go-all 0.7.14 (changelog, source)
Search

Class FileNode

A node representing a File

Import path

import semmle.go.PrintAst

Direct supertypes

Indirect supertypes

Fields

Predicates

getChild

Gets a child of this node, moving the package-name expression to the front of the list if one exists.

getChildEdgeLabel

Gets the label for the edge from this node to the specified child. The package name expression is named ‘package’; others are numbered as per our parent’s implementation of this method.

getProperty

Gets the value of the property of this node, where the name of the property is key.

toString

Gets the string representation of this File. Note explicitly using a relative path like this rather than absolute as per default for the File class is a workaround for a bug with codeql run test, which should replace absolute paths but currently does not.

Inherited predicates

getAChild

Gets a child of this node.

from PrintAstNode
getEnclosingFunction

Gets the FuncDef that contains this node.

from BaseAstNode
getLocation

Gets the location of this node in the source code.

from BaseAstNode
shouldPrint

Holds if this node should be printed in the output. By default, all nodes within a function are printed, but the query can override PrintAstConfiguration.shouldPrintFunction to filter the output.

from PrintAstNode