func LoadPackage(filenames []string) { … } // trimFilename returns the "trimmed" filename of b, which is the // absolute filename after applying -trimpath processing. This // filename form is suitable for use in object files and export data. // // If b's filename has already been trimmed (i.e., because it was read // in from an imported package's export data), then the filename is // returned unchanged. func trimFilename(b *syntax.PosBase) string { … } type noder … type linkname … var unOps … var binOps … // error is called concurrently if files are parsed concurrently. func (p *noder) error(err error) { … } var allowedStdPragmas … type pragmas … type WasmImport … type WasmExport … type pragmaPos … type pragmaEmbed … func (p *noder) checkUnusedDuringParse(pragma *pragmas) { … } // pragma is called concurrently if files are parsed concurrently. func (p *noder) pragma(pos syntax.Pos, blankLine bool, text string, old syntax.Pragma) syntax.Pragma { … } // isCgoGeneratedFile reports whether pos is in a file // generated by cgo, which is to say a file with name // beginning with "_cgo_". Such files are allowed to // contain cgo directives, and for security reasons // (primarily misuse of linker flags), other files are not. // See golang.org/issue/23672. // Note that cmd/go ignores files whose names start with underscore, // so the only _cgo_ files we will see from cmd/go are generated by cgo. // It's easy to bypass this check by calling the compiler directly; // we only protect against uses by cmd/go. func isCgoGeneratedFile(pos syntax.Pos) bool { … } // safeArg reports whether arg is a "safe" command-line argument, // meaning that when it appears in a command-line, it probably // doesn't have some special meaning other than its own name. // This is copied from SafeArg in cmd/go/internal/load/pkg.go. func safeArg(name string) bool { … } // parseGoEmbed parses the text following "//go:embed" to extract the glob patterns. // It accepts unquoted space-separated patterns as well as double-quoted and back-quoted Go strings. // go/build/read.go also processes these strings and contains similar logic. func parseGoEmbed(args string) ([]string, error) { … } var renameinitgen … func Renameinit() *types.Sym { … } func checkEmbed(decl *syntax.VarDecl, haveEmbed, withinFunc bool) error { … }