goload

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

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

Overview

Package goload loads the Go packages of an app for the compiler and the analyzers.

go/packages can type-check a module, but with an overlay it loads every dependency from source: the standard library and each module the app needs. The compiler always has an overlay, so each analysis parsed and checked all of that again (NFR-05). This loader lists the packages with go/packages, type-checks the packages of the app from source and reads each dependency from the export data that the Go build cache holds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader struct {
	// Dir is the directory of the app.
	Dir string
	// contains filtered or unexported fields
}

Loader loads the packages below one directory. It keeps the export file of each dependency, so a second load of the same app lists them one time.

func (*Loader) Load

func (l *Loader) Load(overlay map[string][]byte) ([]*packages.Package, error)

Load lists the packages that "./..." names below Dir and type-checks them from source. overlay holds file contents that replace or add files. Each returned package has Fset, Syntax, Types, TypesInfo and TypeErrors. A package that the returned ones import has Types and no Syntax.

Jump to

Keyboard shortcuts

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