@@ -157,7 +157,7 @@ func (s *snapshot) load(ctx context.Context, allowNetwork bool, scopes ...loadSc
157
157
158
158
moduleErrs := make (map [string ][]packages.Error ) // module path -> errors
159
159
filterer := buildFilterer (s .view .rootURI .Filename (), s .view .gomodcache , s .view .Options ())
160
- newMetadata := make (map [PackageID ]* Metadata )
160
+ newMetadata := make (map [PackageID ]* source. Metadata )
161
161
for _ , pkg := range pkgs {
162
162
// The Go command returns synthetic list results for module queries that
163
163
// encountered module errors.
@@ -222,7 +222,7 @@ func (s *snapshot) load(ctx context.Context, allowNetwork bool, scopes ...loadSc
222
222
//
223
223
// TODO(rfindley): perform a sanity check that metadata matches here. If not,
224
224
// we have an invalidation bug elsewhere.
225
- updates := make (map [PackageID ]* Metadata )
225
+ updates := make (map [PackageID ]* source. Metadata )
226
226
var updatedIDs []PackageID
227
227
for _ , m := range newMetadata {
228
228
if existing := s .meta .metadata [m .ID ]; existing == nil {
@@ -475,7 +475,7 @@ func makeWorkspaceDir(ctx context.Context, workspace *workspace, fs source.FileS
475
475
// buildMetadata populates the updates map with metadata updates to
476
476
// apply, based on the given pkg. It recurs through pkg.Imports to ensure that
477
477
// metadata exists for all dependencies.
478
- func buildMetadata (ctx context.Context , pkg * packages.Package , cfg * packages.Config , query []string , updates map [PackageID ]* Metadata , path []PackageID ) error {
478
+ func buildMetadata (ctx context.Context , pkg * packages.Package , cfg * packages.Config , query []string , updates map [PackageID ]* source. Metadata , path []PackageID ) error {
479
479
// Allow for multiple ad-hoc packages in the workspace (see #47584).
480
480
pkgPath := PackagePath (pkg .PkgPath )
481
481
id := PackageID (pkg .ID )
@@ -507,15 +507,15 @@ func buildMetadata(ctx context.Context, pkg *packages.Package, cfg *packages.Con
507
507
}
508
508
509
509
// Recreate the metadata rather than reusing it to avoid locking.
510
- m := & Metadata {
510
+ m := & source. Metadata {
511
511
ID : id ,
512
512
PkgPath : pkgPath ,
513
513
Name : PackageName (pkg .Name ),
514
514
ForTest : PackagePath (packagesinternal .GetForTest (pkg )),
515
515
TypesSizes : pkg .TypesSizes ,
516
516
Config : cfg ,
517
517
Module : pkg .Module ,
518
- depsErrors : packagesinternal .GetDepsErrors (pkg ),
518
+ DepsErrors : packagesinternal .GetDepsErrors (pkg ),
519
519
}
520
520
updates [id ] = m
521
521
@@ -606,7 +606,7 @@ func buildMetadata(ctx context.Context, pkg *packages.Package, cfg *packages.Con
606
606
// snapshot s.
607
607
//
608
608
// s.mu must be held while calling this function.
609
- func containsPackageLocked (s * snapshot , m * Metadata ) bool {
609
+ func containsPackageLocked (s * snapshot , m * source. Metadata ) bool {
610
610
// In legacy workspace mode, or if a package does not have an associated
611
611
// module, a package is considered inside the workspace if any of its files
612
612
// are under the workspace root (and not excluded).
@@ -647,7 +647,7 @@ func containsPackageLocked(s *snapshot, m *Metadata) bool {
647
647
// the snapshot s.
648
648
//
649
649
// s.mu must be held while calling this function.
650
- func containsOpenFileLocked (s * snapshot , m * Metadata ) bool {
650
+ func containsOpenFileLocked (s * snapshot , m * source. Metadata ) bool {
651
651
uris := map [span.URI ]struct {}{}
652
652
for _ , uri := range m .CompiledGoFiles {
653
653
uris [uri ] = struct {}{}
@@ -668,7 +668,7 @@ func containsOpenFileLocked(s *snapshot, m *Metadata) bool {
668
668
// workspace of the snapshot s.
669
669
//
670
670
// s.mu must be held while calling this function.
671
- func containsFileInWorkspaceLocked (s * snapshot , m * Metadata ) bool {
671
+ func containsFileInWorkspaceLocked (s * snapshot , m * source. Metadata ) bool {
672
672
uris := map [span.URI ]struct {}{}
673
673
for _ , uri := range m .CompiledGoFiles {
674
674
uris [uri ] = struct {}{}
@@ -738,7 +738,7 @@ func computeWorkspacePackagesLocked(s *snapshot, meta *metadataGraph) map[Packag
738
738
// function returns false.
739
739
//
740
740
// If m is not a command-line-arguments package, this is trivially true.
741
- func allFilesHaveRealPackages (g * metadataGraph , m * Metadata ) bool {
741
+ func allFilesHaveRealPackages (g * metadataGraph , m * source. Metadata ) bool {
742
742
n := len (m .CompiledGoFiles )
743
743
checkURIs:
744
744
for _ , uri := range append (m .CompiledGoFiles [0 :n :n ], m .GoFiles ... ) {
0 commit comments