func go.pact.im/x/plumb/internal/diag.Errorf
67 uses
go.pact.im/x/plumb/internal/diag (current package)
diag.go#L78: func Errorf(pos token.Position, kind ErrorKind, detail string, args ...any) *Error {
go.pact.im/x/plumb/internal/discover
discover.go#L54: return nil, diag.Errorf(diag.PosIn(fset, c.Pos()), diag.ErrInvalidSetName,
discover.go#L58: return nil, diag.Errorf(diag.PosIn(fset, c.Pos()), diag.ErrInvalidSetName,
discover.go#L65: return nil, diag.Errorf(diag.PosIn(fset, c.Pos()), diag.ErrDuplicateDirective,
discover.go#L190: return diag.Errorf(diag.PosIn(pkg.Fset, c.Pos()), diag.ErrMisplacedDirective,
discover.go#L268: return nil, diag.Errorf(diag.PosIn(pkg.Fset, fd.Name.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", fd.Name.Name)
discover.go#L281: return nil, diag.Errorf(pos, diag.ErrBlankProvider, "give the %s a name; a blank identifier declares nothing to wire", what)
discover.go#L288: return nil, diag.Errorf(pos, diag.ErrInitProvider, "init cannot be referenced, so it cannot provide; rename the function")
discover.go#L308: return nil, diag.Errorf(pos, diag.ErrInvalidType, "method %s has an unresolvable receiver type", obj.Name())
discover.go#L354: return nil, diag.Errorf(diag.PosIn(pkg.Fset, c.Pos()), diag.ErrMisplacedDirective,
discover.go#L406: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Names[0].Pos()), diag.ErrBlankProvider, "give the variable a name; a blank identifier declares nothing to wire")
discover.go#L420: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
discover.go#L440: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "must declare an explicit target type")
discover.go#L449: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "needs a source like (*T)(nil); write the source type explicitly")
discover.go#L462: return nil, diag.Errorf(pos, diag.ErrInvalidType, "conversion source did not type-check; cannot wire it")
discover.go#L465: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "bare nil source; write (*Concrete)(nil) or name the source type")
discover.go#L476: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "the source must name a type, e.g. (*T)(nil); a constant takes the target's own type")
discover.go#L478: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "identity conversion: source and target are both %s", gotypes.TypeName(targetType))
discover.go#L486: return nil, diag.Errorf(pos, diag.ErrInvalidConversion, "cannot convert %s to %s", gotypes.TypeName(srcType), gotypes.TypeName(targetType))
discover.go#L505: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Names[0].Pos()), diag.ErrBlankProvider, "give the constant a name; a blank identifier declares nothing to wire")
discover.go#L515: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
discover.go#L519: return nil, diag.Errorf(pos, diag.ErrUntypedConstant, "constant %s must have an explicit type", obj.Name())
discover.go#L547: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Name.Pos()), diag.ErrBlankProvider, "give the type a name; a blank identifier declares nothing to wire")
discover.go#L552: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Name.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", s.Name.Name)
discover.go#L585: return nil, diag.Errorf(diag.PosIn(pkg.Fset, s.Name.Pos()), diag.ErrBlankProvider, "give the type a name; its members cannot be reached through a blank identifier")
discover.go#L592: return nil, diag.Errorf(diag.PosIn(pkg.Fset, c.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire its members", s.Name.Name)
discover.go#L630: return nil, diag.Errorf(pos, diag.ErrStructProvider, "%s is %s; struct-type providers are only supported on struct types",
discover.go#L668: return nil, diag.Errorf(pos, diag.ErrEmbeddedField, "give the field a name to use it")
discover.go#L673: return nil, diag.Errorf(pos, diag.ErrBlankProvider, "give the field a name; a blank identifier declares nothing to wire")
discover.go#L687: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
discover.go#L722: return nil, diag.Errorf(pos, diag.ErrEmbeddedInterface, "put the directive on a method instead")
discover.go#L726: return nil, diag.Errorf(pos, diag.ErrConstraintInterfaceMethod, "%s: a constraint type cannot be the type of a value, so it cannot be a receiver", gotypes.TypeNameOf(owner).Name())
discover.go#L733: return nil, diag.Errorf(diag.PosIn(pkg.Fset, ident.Pos()), diag.ErrInvalidType, "declaration of %s did not type-check; cannot wire it", ident.Name)
go.pact.im/x/plumb/internal/gen
gen.go#L62: return nil, diag.Errorf(token.Position{}, diag.ErrNoDirectives, "nothing to generate")
gen.go#L124: return nil, diag.Errorf(diag.PosIn(pkg.Fset, obj.Pos()), diag.ErrDestShadowsPredeclared, "destination package %q declares %s (%s), shadowing the predeclared identifier; rename the declaration", opts.ImportPath, name, base)
go.pact.im/x/plumb/internal/solve
checks.go#L21: return diag.Errorf(p.Pos, diag.ErrInvalidType, "provider %s is instantiated at %s", p.Name, gotypes.TypeName(ta))
checks.go#L25: return diag.Errorf(p.Pos, diag.ErrInvalidType, "conversion %s", p.Name)
checks.go#L34: return diag.Errorf(p.Pos, diag.ErrUnexportedProvider, "provider %s referenced from package %q; export it or generate into its own package", p.Name, s.destPath)
checks.go#L47: return diag.Errorf(p.Pos, diag.ErrUnreachableType, "type argument %s of provider %s, from package %q (%s is unexported)", gotypes.TypeName(ta), p.Name, obj.Pkg().Path(), obj.Name())
checks.go#L54: return diag.Errorf(p.Pos, diag.ErrUnreachableType, "conversion target type %s from package %q (%s is unexported)", gotypes.TypeName(p.ConvertTo), obj.Pkg().Path(), obj.Name())
checks.go#L62: return diag.Errorf(pl.pos, diag.ErrInvalidType, "injector input type %s", gotypes.TypeName(t))
checks.go#L65: return diag.Errorf(pl.pos, diag.ErrUnreachableType, "injector input type %s, from package %q (%s is unexported)", gotypes.TypeName(t), obj.Pkg().Path(), obj.Name())
checks.go#L70: return diag.Errorf(pl.pos, diag.ErrInvalidType, "injector output type %s", gotypes.TypeName(t))
checks.go#L73: return diag.Errorf(pl.pos, diag.ErrUnreachableType, "injector output type %s, from package %q (%s is unexported)", gotypes.TypeName(t), obj.Pkg().Path(), obj.Name())
checks.go#L87: return diag.Errorf(pl.pos, diag.ErrInvalidType, "lifted type parameter %s has a constraint that does not type-check", tp.Obj().Name())
checks.go#L90: return diag.Errorf(pl.pos, diag.ErrUnreachableType, "lifted type parameter %s has a constraint from package %q (%s is unexported)", tp.Obj().Name(), obj.Pkg().Path(), obj.Name())
checks.go#L143: return diag.Errorf(pl.pos, diag.ErrReservedName, "set %q would generate a func init; init must take no parameters and return nothing", s.name)
checks.go#L146: return diag.Errorf(pl.pos, diag.ErrReservedName, "set %q would generate a func main in package main", s.name)
checks.go#L157: return diag.Errorf(pl.pos, diag.ErrShadowsPredeclared, "set %q would generate a top-level func %q shadowing the builtin for the whole destination package; rename the set", s.name, s.name)
checks.go#L176: return diag.Errorf(pl.pos, diag.ErrSetNameCollision, "set %q in package %q (%s); rename the set", s.name, s.destPath, base)
checks.go#L185: return diag.Errorf(pl.pos, diag.ErrSetNameCollision, "set %q matches an import qualifier in package %q (%s); rename the set", s.name, s.destPath, base)
instance.go#L254: return diag.Errorf(p.Pos, diag.ErrMultipleErrors, "provider %s returns more than one error result; at most one is supported", p.Name)
order.go#L153: return diag.Errorf(cycle[0].pos, diag.ErrDependencyCycle, "set %q: %s", s.name, strings.Join(parts, " → "))
solve.go#L242: return nil, diag.Errorf(provs[0].Pos, diag.ErrNonTerminating, "set %q: pinning revision did not converge after %d restarts", name, maxRestarts)
solve.go#L294: return diag.Errorf(p.Pos, diag.ErrBareTypeParamResult, "provider %s would match every demand", p.Name)
solve.go#L297: return diag.Errorf(p.Pos, diag.ErrBareTypeParamResult, "provider %s produces *T for a bare type parameter, matching every pointer demand and, through the value/pointer bridge, every value demand", p.Name)
solve.go#L557: return false, diag.Errorf(p.Pos, diag.ErrNonTerminating, "set %q: produced type %s exceeds depth %d", s.name, gotypes.TypeName(vo), maxTypeDepth)
solve.go#L563: return false, diag.Errorf(p.Pos, diag.ErrNonTerminating, "set %q exceeded %d instantiations; a provider appears to manufacture unboundedly larger types", s.name, maxInstantiations)
solve.go#L617: return diag.Errorf(in.pos, diag.ErrAmbiguousProducer, "provider %s produces multiple values of type %s", in.Prov.Name, gotypes.TypeName(vo))
solve.go#L625: return diag.Errorf(in.pos, diag.ErrAmbiguousProducer, "provider %s produces %s at more than one instantiation; this result does not depend on the type parameter: give it a type-parameter-dependent type or split the provider", in.Prov.Name, gotypes.TypeName(vo))
solve.go#L649: return diag.Errorf(p.Pos, diag.ErrUnusedTemplate, "provider %s in set %q is never instantiated: %w", p.Name, s.name, reason)
solve.go#L659: return diag.Errorf(p.Pos, diag.ErrUnusedTemplate, "provider %s in set %q: %s is already %s, so no demand is left for it: remove the template or the other provider", p.Name, s.name, gotypes.TypeName(d), by)
solve.go#L661: return diag.Errorf(p.Pos, diag.ErrUnusedTemplate, "provider %s in set %q: no consumer pins its result type: add a consumer or remove it", p.Name, s.name)
solve.go#L750: return diag.Errorf(in.pos, diag.ErrInvalidType, "provider %s references %s", in.Prov.Name, gotypes.TypeName(t))
solve.go#L764: return diag.Errorf(cs[0].prov.Pos, diag.ErrAmbiguousTemplates, "templates %s and %s both match one demand",
solve.go#L818: return diag.Errorf(ps[0].Pos, diag.ErrAmbiguousTemplates, "templates %s and %s both produce %s",
solve.go#L827: return diag.Errorf(first.pos, diag.ErrAmbiguousProducer, "type %s is produced by both %s (%s) and %s (%s); plumb never picks a winner",