package diag
Import Path
go.pact.im/x/plumb/internal/diag (on go.dev)
Dependency Relation
imports 4 packages, and imported by 3 packages
Involved Source Files
Package diag holds plumb's diagnostic vocabulary: the located, user-facing
error type, the sentinel errors every phase wraps, and the position helpers
that order diagnostics deterministically. It is the leaf every other package
reaches for when it must reject input or compare source positions.
Package-Level Type Names (total 2, both are exported)
Error is a located, user-facing diagnostic. It wraps one of the sentinel
errors above (reachable with errors.Is and errors.Unwrap) and carries the
source position where the problem occurred. Violations of plumb's own
internal invariants are panics instead, never *Error.
// sentinel wrapped with the specific detail
// the offending source position; zero if none applies
(*Error) Error() string
Unwrap exposes the wrapped chain so errors.Is/As reach the sentinel.
*Error : error
func Earlier(a, b *Error) *Error
func Errorf(pos token.Position, kind ErrorKind, detail string, args ...any) *Error
func Sentinel(msg string) *Error
func go.pact.im/x/plumb/internal/discover.Analyze(pkgs []*discover.Package, destPath, outputBase string) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/solve.Set(name string, provs []*discover.Provider, destPath, outputBase string, dest *solve.DestInfo, ctxt *types.Context) (*solve.Plan, *Error)
func go.pact.im/x/plumb/internal/discover.appendDirectiveNames(prior []string, doc *ast.CommentGroup, fset *token.FileSet) ([]string, *Error)
func go.pact.im/x/plumb/internal/discover.directiveNames(doc *ast.CommentGroup, fset *token.FileSet) ([]string, *Error)
func go.pact.im/x/plumb/internal/discover.reportStrayDirectives(pkg *discover.Package, file *ast.File) *Error
func go.pact.im/x/plumb/internal/discover.scanConst(pkg *discover.Package, s *ast.ValueSpec, names []string) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanConversion(pkg *discover.Package, s *ast.ValueSpec, ident *ast.Ident, names []string) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanFile(pkg *discover.Package, file *ast.File) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanFunc(pkg *discover.Package, fd *ast.FuncDecl) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanGenDecl(pkg *discover.Package, gd *ast.GenDecl) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanInterfaceMethods(pkg *discover.Package, it *ast.InterfaceType, owner types.Type) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanStructFields(pkg *discover.Package, st *ast.StructType, owner types.Type) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanTypeSpec(pkg *discover.Package, gd *ast.GenDecl, s *ast.TypeSpec) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanValueSpec(pkg *discover.Package, gd *ast.GenDecl, s *ast.ValueSpec) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.scanVar(pkg *discover.Package, s *ast.ValueSpec, names []string) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/discover.specDirectiveNames(gd *ast.GenDecl, specDoc *ast.CommentGroup, fset *token.FileSet) ([]string, *Error)
func go.pact.im/x/plumb/internal/discover.structProviders(pkg *discover.Package, s *ast.TypeSpec, tn *types.TypeName, names []string) ([]*discover.Provider, *Error)
func go.pact.im/x/plumb/internal/gen.buildDestInfo(opts gen.Options, pkgs []*discover.Package) (*solve.DestInfo, *Error)
func go.pact.im/x/plumb/internal/solve.ambiguousProducers(a, b *solve.Instance, t types.Type) *Error
func go.pact.im/x/plumb/internal/solve.ambiguousTemplates(cs []solve.matchCand) *Error
func go.pact.im/x/plumb/internal/solve.ambiguousTemplatesFor(ps []*discover.Provider, d types.Type) *Error
func go.pact.im/x/plumb/internal/solve.classifyResults(p *discover.Provider, in *solve.Instance, sig *types.Signature) *Error
func go.pact.im/x/plumb/internal/solve.instantiate(p *discover.Provider, ctxt *types.Context, targs []types.Type) (in *solve.Instance, err *Error, miss error)
func Earlier(a, b *Error) *Error
var go.pact.im/x/plumb/internal/solve.errRestart *Error
ErrorKind is a sentinel diagnostic kind: a constant string that implements
error. Making it a named string type lets the sentinels below be true compile-
time constants while still being wrappable and matchable with errors.Is (a
string is comparable, so errors.Is compares them by value).
Error returns the sentinel's message.
ErrorKind : error
func Errorf(pos token.Position, kind ErrorKind, detail string, args ...any) *Error
const ErrAmbiguousProducer
const ErrAmbiguousTemplates
const ErrBareTypeParamResult
const ErrBlankProvider
const ErrConstraintInterfaceMethod
const ErrDependencyCycle
const ErrDestShadowsPredeclared
const ErrDuplicateDirective
const ErrEmbeddedField
const ErrEmbeddedInterface
const ErrInitProvider
const ErrInvalidConversion
const ErrInvalidSetName
const ErrInvalidType
const ErrMisplacedDirective
const ErrMultipleErrors
const ErrNoDirectives
const ErrNonTerminating
const ErrReservedName
const ErrSetNameCollision
const ErrShadowsPredeclared
const ErrStructProvider
const ErrUnexportedProvider
const ErrUnreachableType
const ErrUntypedConstant
const ErrUnusedTemplate
Package-Level Functions (total 5, all are exported)
CmpPos orders positions deterministically: by file name, then byte offset.
This is the single ordering authority for source-anchored decisions. Read
order (of packages, files, or map entries) never participates. It is the
int-returning comparator backing slices.SortFunc/SortStableFunc/MinFunc.
Earlier returns the source-earlier of two diagnostics by CmpPos, treating a nil
*Error as "no fault" (later than any real one); it returns nil only when both
are nil. Use it to report the fault a reader would fix first when a phase finds
faults out of source order.
Errorf builds a located *Error wrapping the given sentinel kind. detail is a
Printf-style format describing the specifics; it should not repeat the
sentinel's own words.
PosIn resolves p to a token.Position within fset, returning the zero Position
when fset is nil or p is invalid.
Sentinel returns a positionless *Error wrapping msg. It exists for internal
control-flow signals that ride the *Error return channel but are compared by
identity, never by content: unlike a zero-value *Error (whose nil wrapped err
makes Error() panic), a Sentinel is safe to format if one is ever accidentally
printed or logged.
Package-Level Constants (total 26, all are exported)
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
Sentinel errors for every condition plumb can reject. Each diagnostic wraps
one of these, so callers and tests can classify a failure with errors.Is
rather than matching message text. The human-readable specifics travel in the
wrapped detail; the source position travels on *Error.
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64)