Standard library / go/build

go/build.ToolDir

Directory containing installed Go build tools. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ToolDir string

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/build"  "os")
func main() { i, e := os.Stat(build.ToolDir); fmt.Println(e == nil && i.IsDir()) }
Go Reference