github.com/octohelm/cuemod@v0.9.4/pkg/cuemod/builtin/builtins.go (about)

     1  package builtin
     2  
     3  import (
     4  	"bufio"
     5  	"bytes"
     6  	_ "embed"
     7  )
     8  
     9  //go:embed builtins.txt
    10  var list []byte
    11  
    12  var builtins = map[string]bool{}
    13  
    14  func init() {
    15  	scanner := bufio.NewScanner(bytes.NewBuffer(list))
    16  	for scanner.Scan() {
    17  		importPath := scanner.Text()
    18  		if importPath != "" {
    19  			builtins[importPath] = true
    20  		}
    21  	}
    22  }
    23  
    24  func IsBuiltIn(importPath string) bool {
    25  	if _, ok := builtins[importPath]; ok {
    26  		return true
    27  	}
    28  	return false
    29  }