github.com/visualfc/goembed@v0.3.3/parser/parser_go116.go (about)

     1  //go:build go1.16
     2  // +build go1.16
     3  
     4  package parser
     5  
     6  import (
     7  	"go/token"
     8  	_ "unsafe"
     9  )
    10  
    11  // parseGoEmbed parses the text following "//go:embed" to extract the glob patterns.
    12  // It accepts unquoted space-separated patterns as well as double-quoted and back-quoted Go strings.
    13  // This is based on a similar function in cmd/compile/internal/gc/noder.go;
    14  // this version calculates position information as well.
    15  //go:linkname parseGoEmbed go/build.parseGoEmbed
    16  func parseGoEmbed(args string, pos token.Position) ([]fileEmbed, error)