type PackageIndex … // NewPackageIndex creates a new PackageIndex instance for use in building // reference and package sets. func NewPackageIndex() *PackageIndex { … } // IndexID returns the packageIdx referencing id, creating one if id is not yet // tracked by the receiver. func (index *PackageIndex) IndexID(id metadata.PackageID) IndexID { … } // PackageID returns the PackageID for idx. // // idx must have been created by this PackageIndex instance. func (index *PackageIndex) PackageID(idx IndexID) metadata.PackageID { … } type PackageSet … type blockType … const blockSize … // NewSet creates a new PackageSet bound to this PackageIndex instance. // // PackageSets may only be combined with other PackageSets from the same // instance. func (index *PackageIndex) NewSet() *PackageSet { … } // DeclaringPackage returns the ID of the symbol's declaring package. // The package index must be the one used during decoding. func (index *PackageIndex) DeclaringPackage(sym Symbol) metadata.PackageID { … } // Add records a new element in the package set, for the provided package ID. func (s *PackageSet) AddPackage(id metadata.PackageID) { … } // Add records a new element in the package set. // It is the caller's responsibility to ensure that idx was created with the // same PackageIndex as the PackageSet. func (s *PackageSet) Add(idx IndexID) { … } // Union records all elements from other into the receiver, mutating the // receiver set but not the argument set. The receiver must not be nil, but the // argument set may be nil. // // Precondition: both package sets were created with the same PackageIndex. func (s *PackageSet) Union(other *PackageSet) { … } // Contains reports whether id is contained in the receiver set. func (s *PackageSet) Contains(id metadata.PackageID) bool { … } // Elems calls f for each element of the set in ascending order. func (s *PackageSet) Elems(f func(IndexID)) { … } // String returns a human-readable representation of the set: {A, B, ...}. func (s *PackageSet) String() string { … }