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.
- No changes yet.
1.7.0 - 2019-01-04
- Added
Groupoption forProvideto add value groups to the container without rewriting constructors. See package doucmentation for more information.
1.6.0 - 2018-11-06
- When an error graph is visualized, the graph is pruned so that the graph only contains failure nodes.
- Container visualization is now oriented from right to left.
1.5.1 - 2018-11-01
- Fixed a test that was causing Dig to be unusable with Go Modules.
1.5.0 - 2018-09-19
- Added a
DeferAcyclicVerificationcontainer option that defers graph cycle detection until the next Invoke.
- Improved cycle-detection performance by 50x in certain degenerative cases.
1.4.0 - 2018-08-16
- Added
Visualizefunction 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. - Added
CanVisualizeErrorfunction to determine if an error can be visualized in the graph. - Added
Nameoption forProvideto 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.
1.3.0 - 2017-12-04
- Improved messages for errors thrown by Dig under a many scenarios to be more informative.
1.2.0 - 2017-11-07
dig.Inanddig.Outnow support value groups, making it possible to produce many values of the same type from different constructors. See package documentation for more information.
1.1.0 - 2017-09-15
- Added the
dig.RootCausefunction which allows retrieving the original constructor error that caused anInvokefailure.
- Errors from
Invokenow attempt to hint to the user a presence of a similar type, for example a pointer to the requested type and vice versa.
1.0.0 - 2017-07-31
First stable release: no breaking changes will be made in the 1.x series.
ProvideandInvokewill now fail ifdig.Inordig.Outstructs contain unexported fields. Previously these fields were ignored which often led to confusion.
1.0.0-rc2 - 2017-07-21
- Exported
dig.IsInanddig.IsOutso that consuming libraries can check if a params or return struct embeds thedig.Inanddig.Outtypes, respectively.
- Added variadic options to all public APIS so that new functionality can be introduced post v1.0.0 without introducing breaking changes.
- Functions with variadic arguments can now be passed to
dig.Provideanddig.Invoke. Previously this caused an error, whereas now the args will be ignored.
1.0.0-rc1 - 2017-06-21
First release candidate.
0.5.0 - 2017-06-19
-
dig.Inanddig.Outnow support named instances, i.e.:type param struct { dig.In DB1 DB.Connection `name:"primary"` DB2 DB.Connection `name:"secondary"` }
- Structs compatible with
dig.Inanddig.Outmay now be generated usingreflect.StructOf.
0.4.0 - 2017-06-12
- Add
dig.Inembeddable type for advanced use-cases of specifying dependencies. - Add
dig.Outembeddable type for advanced use-cases of constructors inserting types in the container. - Add support for optional parameters through
optional:"true"tag ondig.Inobjects. - Add support for value types and many built-ins (maps, slices, channels).
- [Breaking] Restrict the API surface to only
ProvideandInvoke. - [Breaking] Update
Providemethod to accept variadic arguments.
- [Breaking] Remove
Must*funcs to greatly reduce API surface area. - Providing constructors with common returned types results in an error.
0.3 - 2017-05-02
- Add functionality to
Provideto support constructor withnreturn objects to be resolved into thedig.Graph - Add
Invokefunction to invoke provided function and insert return objects into thedig.Graph
- Rename
RegisterAllandMustRegisterAlltoProvideAllandMustProvideAll.
0.2 - 2017-03-27
- Rename
RegistertoProvidefor clarity and to recude clash with other Register functions. - Rename
dig.Graphtodig.Container.
- Remove the package-level functions and the
DefaultGraph.
Initial release.