Versions in this module Expand all Collapse all v1 v1.0.0 Aug 27, 2026 Changes in this version + const DefaultMaxPackages + const DefaultMaxSourceBytes + const DefaultMaxSourceFiles + const ModuleReadonly + const ModuleVendor + const ProfilePhaseControlFlow + const ProfilePhaseEffectFacts + const ProfilePhasePackageAnalyzers + const ProfilePhasePackages + const ProfilePhaseResult + const ProfilePhaseSSA + const ProfilePhaseSourceModel + const ProfilePhaseTypes + const UnitcheckerModeEnvironment + const UnitcheckerPrintfIdentity + func AdaptAnalyzer(analyzer *goanalysis.Analyzer, options AnalyzerAdapterOptions) (rules.Rule, error) + func AdaptAnalyzerFactory(factory AnalyzerFactory, options AnalyzerAdapterOptions) (rules.Rule, error) + func IsPackageConfigurationError(err error) bool + func OrderDiagnostics(diagnostics []rules.Diagnostic) []rules.Diagnostic + func RunControlFlow(ctx context.Context, loaded PackageLoadResult, registry *rules.Registry, ...) ([]rules.Diagnostic, error) + func RunSSA(ctx context.Context, loaded PackageLoadResult, registry *rules.Registry, ...) ([]rules.Diagnostic, error) + func RunSyntax(ctx context.Context, file *source.File, registry *rules.Registry, ...) ([]rules.Diagnostic, error) + func RunTypes(ctx context.Context, loaded PackageLoadResult, registry *rules.Registry, ...) ([]rules.Diagnostic, error) + func RunUnitcheckerMode(mode string) bool + func WithPackageFactAnalyzerRunner(ctx context.Context, runner PackageFactAnalyzerRunner) context.Context + type AnalyzerAdapterOptions struct + DependencyFactFilter *AnalyzerDependencyFactFilter + ExternalFactExecution *AnalyzerExternalFactExecution + FlagBindings []AnalyzerFlagBinding + Metadata rules.Metadata + ReadOnlyAudited bool + SuggestedFixes []AnalyzerFixMapping + type AnalyzerDependencyFactFilter struct + Audited bool + Identity string + PackageMayExport func([]AnalyzerDependencyFactSource) (bool, error) + type AnalyzerDependencyFactSource struct + Bytes []byte + Path string + type AnalyzerExternalFactExecution struct + Analyzer string + Audited bool + Identity string + type AnalyzerFactory func() *goanalysis.Analyzer + type AnalyzerFixMapping struct + Audited bool + Description string + Message string + Name string + RequiredImports []rules.ImportRequirement + Safety rules.FixSafety + type AnalyzerFlagBinding struct + Analyzer string + Flag string + Option string + type ModuleMode string + type PackageCacheOptions struct + BuildGoVersion string + CGOEnabled bool + Configuration cache.Digest + FormatterMode string + SourceGoVersion string + Store *cache.Store + ToolVersion string + type PackageConfigurationError struct + func (e *PackageConfigurationError) Error() string + func (e *PackageConfigurationError) Unwrap() error + type PackageDiagnostic struct + Cause PackageDiagnosticCause + Kind packages.ErrorKind + Message string + PackageID string + Position string + Targets []string + func (d PackageDiagnostic) IsCgoBoundary() bool + type PackageDiagnosticCause uint8 + const PackageDiagnosticCauseCgoBoundary + const PackageDiagnosticCauseNone + type PackageFactAnalyzerDiagnostic struct + Analyzer string + Message string + Path string + Range source.Range + SuggestedFixes []PackageFactAnalyzerSuggestedFix + type PackageFactAnalyzerEdit struct + NewText string + Path string + Range source.Range + type PackageFactAnalyzerRequest struct + Analyzer string + Identity string + LoadOptions PackageLoadOptions + PackageErrors bool + Sources PackageSourceSet + type PackageFactAnalyzerRunner interface + RunPackageFactAnalyzer func(context.Context, PackageFactAnalyzerRequest) ([]PackageFactAnalyzerDiagnostic, error) + func NewUnitcheckerFactAnalyzerRunner(options UnitcheckerFactAnalyzerRunnerOptions) (PackageFactAnalyzerRunner, error) + type PackageFactAnalyzerSuggestedFix struct + Edits []PackageFactAnalyzerEdit + Message string + type PackageGraphResult struct + DependencyPackagePaths []string + Diagnostics []PackageDiagnostic + RootPackagePaths []string + func DiscoverPackageGraph(ctx context.Context, options PackageLoadOptions) (PackageGraphResult, error) + type PackageLoadOptions struct + AllowNetwork bool + BuildTags []string + Contracts contracts.Set + Dir string + Env []string + GOARCH string + GOOS string + LoadDependencySyntax bool + LoadEffectFacts bool + MaxPackages int + MaxSourceBytes int64 + MaxSourceFiles int + ModuleMode ModuleMode + Overlay map[string][]byte + Patterns []string + Requirement rules.Requirement + Tests bool + type PackageLoadResult struct + Diagnostics []PackageDiagnostic + Packages []*packages.Package + Requirement rules.Requirement + Sources PackageSourceSet + func LoadPackages(ctx context.Context, options PackageLoadOptions) (PackageLoadResult, error) + type PackageResult struct + DependencyPackagePaths []string + Files []Result + LoadDiagnostics []PackageDiagnostic + Requirement rules.Requirement + RootPackagePaths []string + Selection []rules.Selection + SourceProblems []PackageSourceProblem + Sources PackageSourceSet + func RunPackages(ctx context.Context, registry *rules.Registry, options RunOptions, ...) (PackageResult, error) + type PackageSession struct + func NewPackageSession() *PackageSession + func (s *PackageSession) InvalidateAll() + func (s *PackageSession) Statistics() PackageSessionStatistics + type PackageSessionStatistics struct + FullLoads uint64 + ImportLoads uint64 + IncrementalLoads uint64 + type PackageSourceProblem struct + Digest source.Digest + Message string + Path string + Targets []string + type PackageSourceSet struct + func MergePackageSourceSets(sets ...PackageSourceSet) (PackageSourceSet, error) + func (s PackageSourceSet) Lookup(path string) (*source.File, bool) + func (s PackageSourceSet) Paths() []string + func (s PackageSourceSet) Problems() []PackageSourceProblem + func (s PackageSourceSet) WithProblemTargets(targets []string) (PackageSourceSet, error) + type PhaseProfiler interface + Capture func(phase string) error + type Result struct + BaselineProblems []baseline.Problem + Baselined []rules.Diagnostic + Diagnostics []rules.Diagnostic + Digest source.Digest + PackageID string + Path string + PreexistingDiagnostics []rules.Diagnostic + Requirement rules.Requirement + Selection []rules.Selection + Suppressed []suppressions.SuppressedDiagnostic + SuppressionProblems []suppressions.Problem + Targets []string + UnusedSuppressions []suppressions.Directive + func Run(ctx context.Context, file *source.File, registry *rules.Registry, ...) (Result, error) + type RunOptions struct + Cache *PackageCacheOptions + Except []string + LintLevels []rules.LintLevelDirective + Only []string + Overrides map[string]rules.Severity + PackageSession *PackageSession + PathOverrides []config.LintOverride + PathRoot string + Preset rules.Preset + Presets []rules.Preset + Profile config.Profile + ProfileRules map[string]rules.Severity + Profiler PhaseProfiler + RequireSuppressionReason bool + RuleOptions map[string]rules.OptionSet + SourceGoVersion string + Statistics *Statistics + SuppressionExpiryCutoff string + WarningsAsErrors bool + func (options RunOptions) RuleResolution() (rules.ResolveOptions, error) + func (options RunOptions) RuleResolutionForPath(sourcePath string) (rules.ResolveOptions, error) + type Statistics struct + func NewStatistics() *Statistics + func (s *Statistics) Snapshot() StatisticsSnapshot + type StatisticsCache struct + Hits uint64 + Invalidations uint64 + Lookups uint64 + Misses uint64 + Writes uint64 + type StatisticsMetric struct + AllocatedBytes uint64 + Allocations uint64 + Calls uint64 + Duration time.Duration + type StatisticsRule struct + ID string + Metric StatisticsMetric + Requirement rules.Requirement + type StatisticsSnapshot struct + Cache StatisticsCache + DependencySyntaxReasons []string + EffectFactReasons []string + Files int + MaximumRequirement rules.Requirement + PackageLoads StatisticsMetric + Packages int + Rules []StatisticsRule + Tiers []StatisticsTier + Total StatisticsMetric + type StatisticsTier struct + Metric StatisticsMetric + Reasons []string + Requirement rules.Requirement + type UnitcheckerFactAnalyzerRunnerOptions struct + Executable string + GoBinary string + Parallelism int