Dig Versions Save

A reflection based dependency injection toolkit for Go.

v1.10.0

3 years ago

Added

  • Introduce 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.

v1.9.0

4 years ago

Added

  • GraphViz visualization of the graph now includes names of packages next to constructors.
  • Added a 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.

Changed

  • Drop library dependency on golang.org/x/lint.
  • Support printing multi-line error messages with %+v.

v1.8.0

4 years ago

Changed

  • Migrated to Go modules.

v1.7.0

5 years ago

Added

  • Added Group option for Provide to add value groups to the container without rewriting constructors. See package doucmentation for more information.

v1.6.0

5 years ago

Changed

  • 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.

v1.5.1

5 years ago

Fixed

  • Fixed a test that was causing Dig to be unusable with Go Modules.

v1.5.0

5 years ago

Added

  • Added a DeferAcyclicVerification container option that defers graph cycle detection until the next Invoke.

Changed

  • Improved cycle-detection performance by 50x in certain degenerative cases.

v1.4.0

5 years ago

Added

  • Added 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.
  • Added CanVisualizeError function to determine if an error can be visualized in the graph.
  • Added Name option for Provide to add named values to the container without rewriting constructors. See package documentation for more information.

Changed

  • name:"..." tags on nested Result Objects will now cause errors instead of being ignored.

v1.3.0

6 years ago
  • Improved messages for errors thrown by Dig under a many scenarios to be more informative.

v1.2.0

6 years ago
  • 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.