Help us shape the future of Go! Take the 2026 Go Developer Survey

assetusage

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package assetusage finds statically referenced generated assets in cartridge source.

Index

Constants

View Source
const (
	ReasonTypedReference = "typed reference"
	ReasonStaticName     = "static logical name"
	ReasonDynamicLookup  = "dynamic texture lookup retains the project texture scope"
	ReasonAnalysisFailed = "type analysis was incomplete; retaining the project texture scope"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v0.0.2

type Options struct {
	Compiler string
}

Options selects the cartridge compiler whose source constraints are analyzed. An empty Compiler selects the standard Go WASI target.

type Result

type Result struct {
	Live       map[string]string
	KeepAll    bool
	Diagnostic string
}

Result describes the conservative live texture set.

func Analyze

func Analyze(directory, modulePath string, names []string) Result

Analyze type-checks the generated engine package together with project source. An analysis uncertainty retains all assets instead of risking a false strip.

func AnalyzeUI

func AnalyzeUI(directory, modulePath string, names []string) Result

AnalyzeUI retains named UI references and conservatively retains the complete UI scope when a lookup is dynamic, a method escapes, or typing is incomplete.

func AnalyzeUIWithComponents added in v0.0.2

func AnalyzeUIWithComponents(directory, modulePath string, names []string, components []uicompiler.Component) Result

AnalyzeUIWithComponents shares the exact compiled component graph with build.

func AnalyzeUIWithOptions added in v0.0.2

func AnalyzeUIWithOptions(directory, modulePath string, names []string, components []uicompiler.Component, options Options) Result

AnalyzeUIWithOptions selects source for the cartridge's compiler and target.

func AnalyzeWithOptions added in v0.0.2

func AnalyzeWithOptions(directory, modulePath string, names []string, components []uicompiler.Component, options Options) Result

AnalyzeWithOptions uses the same WASI source selection as the cartridge build.

func AnalyzeWithUI added in v0.0.2

func AnalyzeWithUI(directory, modulePath string, names []string, components []uicompiler.Component) Result

AnalyzeWithUI uses the build's resolved components, including package exports. Nil components preserve standalone project discovery and conservative fallback.

Jump to

Keyboard shortcuts

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