cache

package
v1.26.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HashInvalid = "?"
	HashSkip    = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

Impl represents a cache.

func New

func New(h PkgHash) *Impl

New creates a new cache.

func (*Impl) Find

func (p *Impl) Find(dir, pkgPath string) (f io.ReadCloser, err error)

Find finds the cache for a pkgPath.

func (*Impl) ListTimes

func (p *Impl) ListTimes() int

ListTimes returns the number of times of calling `go list`.

func (*Impl) Load

func (p *Impl) Load(cacheFile string) (err error)

Load loads the cache from a file.

func (*Impl) Prepare

func (p *Impl) Prepare(dir string, pkgPath ...string) (err error)

Prepare prepares the cache for a list of pkgPath.

func (*Impl) Save

func (p *Impl) Save(cacheFile string) (err error)

Save saves the cache to a file.

func (*Impl) SetTags added in v1.16.5

func (p *Impl) SetTags(tags string)

SetTags sets the build tags for the import cache.

func (*Impl) Tags added in v1.16.5

func (p *Impl) Tags() string

Tags returns the build tags for the import cache.

type PkgHash

type PkgHash func(pkgPath string, self bool) (hash string)

PkgHash represents a package hash function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL