Standard Library

GoConstant

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

Other Methods

.BinaryOp()Neutral
#
Signature
BinaryOp(x_ Value, op token.Token, y_ Value) Value

BinaryOp returns the result of the binary expression x op y.

.BitLen()Neutral
#
Signature
BitLen(x Value) int

BitLen returns the number of bits required to represent

.BoolVal()Neutral
#
Signature
BoolVal(x Value) bool

BoolVal returns the Go boolean value of x, which must be a Bool or an Unknown.

.Bytes()Neutral
#
Signature
Bytes(x Value) []byte

Bytes returns the bytes for the absolute value of x in little-

.Compare()Neutral
#
Signature
Compare(x_ Value, op token.Token, y_ Value) bool

Compare returns the result of the comparison x op y.

.Denom()Neutral
#
Signature
Denom(x Value) Value

Denom returns the denominator of x; x must be Int, Float, or Unknown.

.Float32Val()Neutral
#
Signature
Float32Val(x Value) (float32, bool)

Float32Val is like Float64Val but for float32 instead of float64.

.Float64Val()Neutral
#
Signature
Float64Val(x Value) (float64, bool)

Float64Val returns the nearest Go float64 value of x and whether the result is exact;

.Imag()Neutral
#
Signature
Imag(x Value) Value

Imag returns the imaginary part of x, which must be a numeric or unknown value.

.Int64Val()Neutral
#
Signature
Int64Val(x Value) (int64, bool)

Int64Val returns the Go int64 value of x and whether the result is exact;

Fully-Qualified Names

FQNField
go/constantfqns[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 ...  # go/constant