Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ func (c *Car) Start() {
```go
func main() {
// create DI container and inject package services
injector := do.New()
i := do.New()

do.Provide(injector, NewCar)
do.Provide(injector, NewEngine)
do.ProvideValue(&Config{
do.Provide(i, NewCar)
do.Provide(i, NewEngine)
do.ProvideValue(i, &Config{
Port: 4242,
})

Expand All @@ -95,7 +95,7 @@ func main() {
log.Fatal(err.Error())
}

car.Start() // that's all folk 🤗
car.Start() // that's all folk 🤗

// handle ctrl-c and shutdown services
i.ShutdownOnSignals(syscall.SIGTERM, os.Interrupt)
Expand All @@ -112,12 +112,12 @@ var Package = do.Package(
do.Lazy(NewEngine),
do.Eager(&Config{
Port: 4242,
})
}),
)

func main() {
// create DI container and inject package services
injector := do.New(Package)
i := do.New(Package)

// invoking car will instantiate Car services and its Engine dependency
car, err := do.Invoke[*Car](i)
Expand Down