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) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| line | string | Input 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"))}