Documentation
¶
Overview ¶
Package gobuild validates source-backed registrations using the application's Go build context. It compiles packages, never runs their initialization code.
Index ¶
- type Context
- func (c *Context) Clone() *Context
- func (c *Context) Importer(packages ...string) (types.Importer, error)
- func (c *Context) Validate(pkg string, files map[string][]byte) error
- func (c *Context) ValidateFiles(pkg string, files map[string][]byte) ([]string, error)
- func (c *Context) WithContext(ctx context.Context) *Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Dir string
Tags string
Env []string
// contains filtered or unexported fields
}
Context preserves the module/workspace, replacements and build selection. Env supplements the inherited environment. Empty Tags retains GOFLAGS; nonempty Tags explicitly selects the build tags for both validation stages.
func (*Context) Importer ¶
Importer reads Go's build-selected export data. A single importer preserves identity across contracts, aliases and the actual xdatly generic interface.
func (*Context) Validate ¶
Validate overlays staged files at their final locations, so internal-package access and import cycles are checked in the real destination package context. A nil content removes a file. No application files or module files are written.
func (*Context) ValidateFiles ¶
ValidateFiles also returns the build-selected source filenames so metadata loading cannot accidentally reintroduce excluded files after publication.