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

Member predicate ControlFlow::WriteNode::writesElementPreUpdate

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

For example, for the assignment xs[i] = v, base is the post-update node of the data-flow node corresponding to xs or (if xs is a pointer) the implicit dereference *xs, index is the data-flow node corresponding to i, and rhs is the data-flow node corresponding to base. If this WriteNode corresponds to the initialization of an array/slice/map then there is no need for a post-update node and base is the array/slice/map literal being initialized.

predicate writesElementPreUpdate(Node base, Node index, Node rhs)