Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed May 9, 2022
1 parent 17bd145 commit 30ca967
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions container/build.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package container

// Build runs the provided invoker function with values provided by the provided
// options. It is the single entry point for building and running a dependency
// injection container. Invoker should be a function taking one or more
// dependencies from the container, optionally returning an error.
// Build builds the container specified by containerOption and extracts the
// requested outputs from the container or returns an error. It is the single
// entry point for building and running a dependency injection container.
// Each of the values specified as outputs must be pointers to types that
// can be provided by the container.
//
// Ex:
// Build(func (x int) error { println(x) }, Provide(func() int { return 1 }))
// var x int
// Build(Provide(func() int { return 1 }), &x)
func Build(containerOption Option, outputs ...interface{}) error {
loc := LocationFromCaller(1)
return build(loc, nil, containerOption, outputs...)
Expand Down

0 comments on commit 30ca967

Please sign in to comment.