Skip to content

Commit e8aac2b

Browse files
authored
Remove neutral example
Go currently does not use `neutralModel`s and they are less relevant for Go than for Java/C#.
1 parent 27ad882 commit e8aac2b

1 file changed

Lines changed: 0 additions & 34 deletions

File tree

docs/codeql/codeql-language-guides/customizing-library-models-for-go.rst

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -309,40 +309,6 @@ For the remaining values for both rows:
309309

310310
That is, the first row specifies that values can flow from the elements of the qualifier enumerable into the first argument of the function provided to ``Select``. The second row specifies that values can flow from the return value of the function to the elements of the enumerable returned from ``Select``.
311311

312-
Example: Add a ``neutral`` method
313-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314-
This example shows how we can model a method as being neutral with respect to flow. We will also cover how to model a property by modeling the getter of the ``Now`` property of the ``DateTime`` class as neutral.
315-
A neutral model is used to define that there is no flow through a method.
316-
317-
.. code-block:: csharp
318-
319-
public static void TaintFlow() {
320-
System.DateTime t = System.DateTime.Now; // There is no flow from Now to t.
321-
...
322-
}
323-
324-
We need to add a tuple to the ``neutralModel``\(namespace, type, name, signature, kind, provenance) extensible predicate by updating a data extension file.
325-
326-
.. code-block:: yaml
327-
328-
extensions:
329-
- addsTo:
330-
pack: codeql/csharp-all
331-
extensible: neutralModel
332-
data:
333-
- ["System", "DateTime", "get_Now", "()", "summary", "manual"]
334-
335-
336-
Since we are adding a neutral model, we need to add tuples to the ``neutralModel`` extensible predicate.
337-
The first four values identify the callable (in this case the getter of the ``Now`` property) to be modeled as a neutral, the fifth value is the kind, and the sixth value is the provenance (origin) of the neutral.
338-
339-
- The first value ``System`` is the namespace name.
340-
- The second value ``DateTime`` is the class (type) name.
341-
- The third value ``get_Now`` is the method name. Getter and setter methods are named ``get_<name>`` and ``set_<name>`` respectively.
342-
- The fourth value ``()`` is the method input type signature.
343-
- The fifth value ``summary`` is the kind of the neutral.
344-
- The sixth value ``manual`` is the provenance of the neutral.
345-
346312
Example: Accessing the ``Body`` field of an HTTP request
347313
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348314
This example shows how we can model a field read as a source of tainted data.

0 commit comments

Comments
 (0)