Skip to content

Releases: uber-go/dig

v1.2.0

07 Nov 17:29
Compare
Choose a tag to compare
  • 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.

v1.1.0

15 Sep 21:35
Compare
Choose a tag to compare
  • Added the dig.RootCause function which allows retrieving the original
    constructor error that caused an Invoke failure.
  • Errors from 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.

v1.0.0

31 Jul 18:50
Compare
Choose a tag to compare

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.

v1.0.0-rc2

21 Jul 18:21
Compare
Choose a tag to compare
v1.0.0-rc2 Pre-release
Pre-release
  • 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.Provide and
    dig.Invoke. Previously this caused an error, whereas now the args will be ignored.
  • Exported 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.

v1.0.0-rc1

21 Jun 21:18
Compare
Choose a tag to compare
v1.0.0-rc1 Pre-release
Pre-release

First release candidate.

v0.5.0

19 Jun 21:44
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release
  • 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"`
    }
  • Structs compatible with dig.In and dig.Out may now be generated using
    reflect.StructOf.

v0.4.0

12 Jun 20:06
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release
  • [Breaking] Remove Must* funcs to greatly reduce API surface area.
  • [Breaking] Restrict the API surface to only Provide and Invoke.
  • Providing constructors with common returned types results in an error.
  • [Breaking] Update Provide method to accept variadic arguments.
  • Add dig.In embeddable type for advanced use-cases of specifying dependencies.
  • Add dig.Out embeddable type for advanced use-cases of constructors
    inserting types in the container.
  • Add support for optional parameters through optional:"true" tag on dig.In objects.
  • Add support for value types and many built-ins (maps, slices, channels).

v0.3

02 May 20:35
Compare
Choose a tag to compare
v0.3 Pre-release
Pre-release

API renaming and introducing Invoke functionality

  • Rename RegisterAll and MustRegisterAll to ProvideAll and
    MustProvideAll.
  • Add functionality to Provide to support constructor with n return
    objects to be resolved into the dig.Graph
  • Add Invoke function to invoke provided function and insert return
    objects into the dig.Graph

v0.2

28 Mar 00:55
Compare
Choose a tag to compare
v0.2 Pre-release
Pre-release

API cleanup and removal of the global graph

  • Rename Register to Provide for clarity and to reduce clash with other
    Register functions.
  • Rename dig.Graph to dig.Container.
  • Remove the package-level functions and the DefaultGraph.

v0.1

23 Mar 19:10
Compare
Choose a tag to compare
v0.1 Pre-release
Pre-release

This version is all about singleton objects: create them, share them in the graph through constructors, or by registering a pointer directly.