sdk/golang/Standard Library/GoBuildConstraint
Standard Library

GoBuildConstraint

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

Other Methods

.AndExpr.Eval()Neutral
#
Signature
AndExpr.Eval(ok func(tag string) bool) bool

AndExpr.Eval function.

.AndExpr.String()Neutral
#
Signature
AndExpr.String() string

AndExpr.String function.

.GoVersion()Neutral
#
Signature
GoVersion(x Expr) string

GoVersion returns the minimum Go version implied by a given build expression.

.IsGoBuild()Neutral
#
Signature
IsGoBuild(line string) bool

IsGoBuild reports whether the line of text is a “//go:build” constraint.

.IsPlusBuild()Neutral
#
Signature
IsPlusBuild(line string) bool

IsPlusBuild reports whether the line of text is a “// +build” constraint.

.NotExpr.Eval()Neutral
#
Signature
NotExpr.Eval(ok func(tag string) bool) bool

NotExpr.Eval function.

.NotExpr.String()Neutral
#
Signature
NotExpr.String() string

NotExpr.String function.

.OrExpr.Eval()Neutral
#
Signature
OrExpr.Eval(ok func(tag string) bool) bool

OrExpr.Eval function.

.OrExpr.String()Neutral
#
Signature
OrExpr.String() string

OrExpr.String function.

.Parse()Neutral
#
Signature
Parse(line string) (Expr, error)

Parse parses a single build constraint line of the form “//go:build ...” or “// +build ...”

Fully-Qualified Names

FQNField
go/build/constraintfqns[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/build/constraint