Standard Library

GoSlices

Go stdlib package — slices. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.BinarySearch()Neutral
#
Signature
BinarySearch(x S, target E) (int, bool)

BinarySearch searches for target in a sorted slice and returns the position

.BinarySearchFunc()Neutral
#
Signature
BinarySearchFunc(x S, target T, cmp func(E, T) int) (int, bool)

BinarySearchFunc works like [BinarySearch], but uses a custom comparison

.Clip()Neutral
#
Signature
Clip(s S) S

Clip removes unused capacity from the slice, returning s[:len(s):len(s)].

.Clone()Neutral
#
Signature
Clone(s S) S

Clone returns a copy of the slice.

.Compact()Neutral
#
Signature
Compact(s S) S

Compact replaces consecutive runs of equal elements with a single copy.

.CompactFunc()Neutral
#
Signature
CompactFunc(s S, eq func(E, E) bool) S

CompactFunc is like [Compact] but uses an equality function to compare elements.

.Compare()Neutral
#
Signature
Compare(s1 S, s2 S) int

Compare compares the elements of s1 and s2, using [cmp.Compare] on each pair

.CompareFunc()Neutral
#
Signature
CompareFunc(s1 S1, s2 S2, cmp func(E1, E2) int) int

CompareFunc is like [Compare] but uses a custom comparison function on each

.Contains()Neutral
#
Signature
Contains(s S, v E) bool

Contains reports whether v is present in s.

.ContainsFunc()Neutral
#
Signature
ContainsFunc(s S, f func(E) bool) bool

ContainsFunc reports whether at least one

Fully-Qualified Names

FQNField
slicesfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

go.mod
// standard library — no go.mod entry required
rule.py
from codepathfinder.go_rule import ...  # slices