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

errdetect

package
v0.33.30 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package errdetect classifies registry errors for d8 mirror pull with pull-specific causes and solutions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diagnose

func Diagnose(err error) *diagnostic.HelpfulError

Diagnose analyzes an error and returns a *diagnostic.HelpfulError with pull-specific causes and solutions, or nil if the error is not recognized.

func DiagnoseConstraintParseError added in v0.33.5

func DiagnoseConstraintParseError(err error, flagName string, rawValues ...string) *diagnostic.HelpfulError

DiagnoseConstraintParseError explains a filter expression that carries the '@' separator with nothing after it, e.g. "console@".

The usual cause is quoting. An unquoted value is split by the shell before d8 ever sees it:

--include-module console@>=1.43.2

bash keeps the word "console@" and turns ">=1.43.2" into an output redirection into a file named "=1.43.2". A script interpolating a version variable that expanded to nothing lands on the same value, so both causes are offered.

flagName names the flag in the suggestion text (e.g. "include-module"). rawValues are the exact strings cobra stored for that flag. The first one ending with '@' is the entry the parser rejected and is quoted back to the user; without it the caller falls through to its own error.

func DiagnosePlatformConstraintParseError added in v0.33.5

func DiagnosePlatformConstraintParseError(err error, rawValue string) *diagnostic.HelpfulError

DiagnosePlatformConstraintParseError explains a --include-platform value that turned out to be a filesystem path.

The flag takes a bare constraint with no "name@" prefix, so an unquoted value leaves nothing behind:

--include-platform >=1.64 ./bundle

bash redirects ">=1.64" into a file named "=1.64" and the flag swallows the bundle path that followed it, so the constraint parser is handed a directory.

Returns nil for a value that is not path-shaped, so a plain typo in the constraint keeps the parser's own message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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