CodeQL library for Go
codeql/go-all 7.0.0 (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, where base represents the post-update value.

For example, for the assignment x.width = newWidth, base is the post-update node of 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. If this WriteNode is a struct initialization then there is no post-update node and base is the struct literal being initialized.

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