Standard library / go/build/constraint

go/build/constraint.IsPlusBuild()

Recognizes the legacy directive prefix without validating the expression. Expected stdout: 'true false\n'.

Formal Syntax & Structure

go syntaxgo
func IsPlusBuild(line string) bool

Parameters & Attributes

NameTypeDescription
linestringInput to the operation as described above.

Return Value

bool

Recognizes the legacy directive prefix without validating the expression.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/build/constraint")
func main() {  fmt.Println(constraint.IsPlusBuild("// +build linux"), constraint.IsPlusBuild("//go:build linux"))}
Go Reference