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)
/* sort exporteds by: | */
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. (*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 Earlier(a, b *Error) *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.