Archive contains intermediate build outputs of a single package. This is a logical equivalent of an object file in traditional compilers.
| 51 | // |
| 52 | // This is a logical equivalent of an object file in traditional compilers. |
| 53 | type Archive struct { |
| 54 | // Package's full import path, e.g. "some/package/name". |
| 55 | ImportPath string |
| 56 | // Package's name as per "package" statement at the top of a source file. |
| 57 | // Usually matches the last component of import path, but may differ in |
| 58 | // certain cases (e.g. main or test packages). |
| 59 | Name string |
| 60 | // A list of full package import paths that the current package imports across |
| 61 | // all source files. See go/types.Package.Imports(). |
| 62 | Imports []string |
| 63 | // The package information is used by the compiler to type-check packages |
| 64 | // that import this one. See [gcexportdata.Write]. |
| 65 | Package *types.Package |
| 66 | // Compiled package-level symbols. |
| 67 | Declarations []*Decl |
| 68 | // Concatenated contents of all raw .inc.js of the package. |
| 69 | IncJSCode []incjs.File |
| 70 | // The file set containing the source code locations for various symbols |
| 71 | // (e.g. for sourcemap generation). See [token.FileSet.Write]. |
| 72 | FileSet *token.FileSet |
| 73 | // Whether or not the package was compiled with minification enabled. |
| 74 | Minified bool |
| 75 | // A list of go:linkname directives encountered in the package. |
| 76 | GoLinknames []linkname.GoLinkname |
| 77 | } |
| 78 | |
| 79 | func (a Archive) String() string { |
| 80 | return fmt.Sprintf("compiler.Archive{%s}", a.ImportPath) |
nothing calls this directly
no outgoing calls
no test coverage detected