pub struct GoListPackage {Show 14 fields
pub dir: String,
pub import_path: String,
pub name: String,
pub root: String,
pub standard: bool,
pub dep_only: bool,
pub go_files: Vec<String>,
pub cgo_files: Vec<String>,
pub s_files: Vec<String>,
pub embed_patterns: Vec<String>,
pub embed_files: Vec<String>,
pub imports: Vec<String>,
pub import_map: BTreeMap<String, String>,
pub module: Option<GoListModule>,
}Expand description
One go list -json package object. Field names are Go’s PascalCase;
every list/map/bool field defaults so an omitted-when-empty field
(go list’s convention) deserializes cleanly.
Fields§
§dir: StringAbsolute on-disk directory of the package.
import_path: StringCanonical import path — the node id.
name: StringPackage clause name; "main" ⇒ a linkable binary.
root: StringModule root directory this package lives under. For own packages
AND vendored deps this is the main module’s root (vendor/ is
under it); for std it is $GOROOT/src.
standard: boolTrue ⇒ standard-library package (provided by the shared std derivation, never per-node source).
dep_only: boolTrue ⇒ this package is only in the graph as a dependency (never
a queried root) — so it is never a workspace_member.
go_files: Vec<String>Tag-resolved non-test Go sources for this tuple (Go-I6).
cgo_files: Vec<String>cgo sources. Non-empty on a module/main node ⇒ M1 rejects the
build (Go-I12); M-cgo lifts this to kind = Cgo.
s_files: Vec<String>Assembly sources. Non-empty on a non-std node ⇒ M1 rejects (Go-I12); std asm lives inside the opaque std-tree.
embed_patterns: Vec<String>//go:embed patterns (drives -embedcfg).
embed_files: Vec<String>Resolved embed files (relative to Dir).
imports: Vec<String>Direct imports (the per-node DAG edges). Deps (transitive) is
intentionally NOT modeled — the closure is seeded by the full
stream, and per-node importcfg needs only direct edges.
import_map: BTreeMap<String, String>Vendor/replace rewrite: source import path → actual package path.
module: Option<GoListModule>Owning module (own module vs a vendored dep). Absent for std.
Implementations§
Source§impl GoListPackage
impl GoListPackage
Sourcepub fn kind(&self) -> PackageKind
pub fn kind(&self) -> PackageKind
Classify into the M1 PackageKind. cgo/asm nodes are NOT
classified here — the encoder rejects them up front (Go-I12).
Trait Implementations§
Source§impl Clone for GoListPackage
impl Clone for GoListPackage
Source§fn clone(&self) -> GoListPackage
fn clone(&self) -> GoListPackage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more