sdk/golang/Standard Library/GoRuntimeTrace
Standard Library

GoRuntimeTrace

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

Other Methods

.IsEnabled()Neutral
#
Signature
IsEnabled() bool

IsEnabled reports whether tracing is enabled.

.Log()Neutral
#
Signature
Log(ctx context.Context, category string, message string)

Log emits a one-off event with the given category and message.

.Logf()Neutral
#
Signature
Logf(ctx context.Context, category string, format string, args any)

Logf is like [Log], but the value is formatted using the specified format spec.

.NewTask()Neutral
#
Signature
NewTask(pctx context.Context, taskType string) (context.Context, *Task)

NewTask creates a task instance with the type taskType and returns

.Region.End()Neutral
#
Signature
Region.End()

End marks the end of the traced code region.

.Start()Neutral
#
Signature
Start(w io.Writer) error

Start enables tracing for the current program.

.StartRegion()Neutral
#
Signature
StartRegion(ctx context.Context, regionType string) *Region

StartRegion starts a region and returns it.

.Stop()Neutral
#
Signature
Stop()

Stop stops the current tracing, if any.

.Task.End()Neutral
#
Signature
Task.End()

End marks the end of the operation represented by the [Task].

.WithRegion()Neutral
#
Signature
WithRegion(ctx context.Context, regionType string, fn func())

WithRegion starts a region associated with its calling goroutine, runs fn,

Fully-Qualified Names

FQNField
runtime/tracefqns[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 ...  # runtime/trace