]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/go/internal/load/pkg.go
cmd/go, go/build: parse directives in file headers
[gostls13.git] / src / cmd / go / internal / load / pkg.go
index 7c0c104883100d2f8d6a18f342617e7f5f6e6648..11b69cb6f44eb13feff208225733ccb354dd1028 100644 (file)
@@ -230,6 +230,9 @@ type PackageInternal struct {
        TestmainGo        *[]byte              // content for _testmain.go
        Embed             map[string][]string  // //go:embed comment mapping
        OrigImportPath    string               // original import path before adding '_test' suffix
+       Directives        []build.Directive
+       TestDirectives    []build.Directive
+       XTestDirectives   []build.Directive
 
        Asmflags   []string // -asmflags for this package
        Gcflags    []string // -gcflags for this package
@@ -435,6 +438,9 @@ func (p *Package) copyBuild(opts PackageOpts, pp *build.Package) {
        p.TestEmbedPatterns = pp.TestEmbedPatterns
        p.XTestEmbedPatterns = pp.XTestEmbedPatterns
        p.Internal.OrigImportPath = pp.ImportPath
+       p.Internal.Directives = pp.Directives
+       p.Internal.TestDirectives = pp.TestDirectives
+       p.Internal.XTestDirectives = pp.XTestDirectives
 }
 
 // A PackageError describes an error loading information about a package.