All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
DryRun Option which, when set to true, disables invocation
of functions supplied to Provide and Invoke. This option will be
used to build no-op containers, for example for fx.ValidateApp method.flatten modifier to group tags for slices to allow providing
individual elements instead of the slice for a group value. See package
doucmentation for more information.golang.org/x/lint.%+v.Group option for Provide to add value groups to the container without
rewriting constructors. See package doucmentation for more information.DeferAcyclicVerification container option that defers graph cycle
detection until the next Invoke.Visualize function to visualize the state of the container in the
GraphViz DOT format. This allows visualization of error types and the
dependency relationships of types in the container.CanVisualizeError function to determine if an error can be visualized
in the graph.Name option for Provide to add named values to the container
without rewriting constructors. See package documentation for more
information.name:"..." tags on nested Result Objects will now cause errors instead of
being ignored.dig.In and dig.Out now support value groups, making it possible to
produce many values of the same type from different constructors. See package
documentation for more information.dig.RootCause function which allows retrieving the original
constructor error that caused an Invoke failure.Invoke now attempt to hint to the user a presence of a similar
type, for example a pointer to the requested type and vice versa.First stable release: no breaking changes will be made in the 1.x series.
Provide and Invoke will now fail if dig.In or dig.Out structs
contain unexported fields. Previously these fields were ignored which often
led to confusion.dig.IsIn and dig.IsOut so that consuming libraries can check if
a params or return struct embeds the dig.In and dig.Out types, respectively.dig.Provide and
dig.Invoke. Previously this caused an error, whereas now the args will be ignored.First release candidate.
dig.In and dig.Out now support named instances, i.e.:
type param struct {
dig.In
DB1 DB.Connection `name:"primary"`
DB2 DB.Connection `name:"secondary"`
}
dig.In and dig.Out may now be generated using
reflect.StructOf.dig.In embeddable type for advanced use-cases of specifying dependencies.dig.Out embeddable type for advanced use-cases of constructors
inserting types in the container.optional:"true" tag on dig.In objects.Provide and Invoke.Provide method to accept variadic arguments.Must* funcs to greatly reduce API surface area.Provide to support constructor with n return
objects to be resolved into the dig.GraphInvoke function to invoke provided function and insert return
objects into the dig.GraphRegisterAll and MustRegisterAll to ProvideAll and
MustProvideAll.Register to Provide for clarity and to recude clash with other
Register functions.dig.Graph to dig.Container.DefaultGraph.Initial release.