Skip to content

Commit

Permalink
readme typo fixed (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanodevium authored May 9, 2022
1 parent da715e2 commit bef532b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ The following examples demonstrate some named bindings.

```go
// Singleton
err := container.NamedSingleton("square" func() Shape {
err := container.NamedSingleton("square", func() Shape {
return &Rectangle{}
})
err := container.NamedSingleton("rounded" func() Shape {
err := container.NamedSingleton("rounded", func() Shape {
return &Circle{}
})

// Transient
err := container.NamedTransient("sql" func() Database {
err := container.NamedTransient("sql", func() Database {
return &MySQL{}
})
err := container.NamedTransient("noSql" func() Database {
err := container.NamedTransient("noSql", func() Database {
return &MongoDB{}
})
```
Expand All @@ -117,7 +117,7 @@ In this case, you can return the error as the second return value like the examp

```go
err := container.Transient(func() (Shape, error) {
return nil, errors.New("my-app: cannot create a Shaple implementation")
return nil, errors.New("my-app: cannot create a Shape implementation")
})
```

Expand Down Expand Up @@ -261,7 +261,7 @@ The global container is still available.

### Must Helpers

You might believe that the container shouldn't raise any error and you prefer panics.
You might believe that the container shouldn't raise any error and/or you prefer panics.
In this case, Must helpers are for you.
Must helpers are global methods that panic instead of returning errors.

Expand Down

0 comments on commit bef532b

Please sign in to comment.