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

Member predicate ControlFlow::WriteNode::writesField

Holds if this node sets the value of field f on base (or its implicit dereference) to rhs.

For example, for the assignment x.width = newWidth, base is either the data-flow node corresponding to x or (if x is a pointer) the data-flow node corresponding to the implicit dereference *x, f is the field referenced by width, and rhs is the data-flow node corresponding to newWidth.

predicate writesField(Node base, Field f, Node rhs)