Standard library / go/build

go/build.IgnoreVendor

Ignores vendor directories when searching for imports. Demonstrates the mode flag; actual vendor selection is not tested here. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const IgnoreVendor ImportMode = 8

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/build")
func main() { var m build.ImportMode = build.IgnoreVendor; fmt.Println(m&build.IgnoreVendor != 0) }
Go Reference