Skip to content

Commit

Permalink
Format README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
martinarisk authored Nov 25, 2024
1 parent 0525e2b commit 84ec968
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dependency_injection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ di := NewDependencyInjection()
```
## Adding and Removing Dependencies

Add:
### Add:

```go
di.Add(obj interface{})
Expand All @@ -26,7 +26,7 @@ config := NewConfig()
di.Add(config)
```

Remove:
### Remove:
```go
di.Remove(obj interface{})
```
Expand Down Expand Up @@ -120,7 +120,7 @@ The DI container supports various lifetimes to manage the lifecycle of dependenc
Default lifetime. A single instance is shared globally.

### Scoped:
A new instance is created for each logical "scope" (e.g., per request). Use NewScopedDependencyInjection.
A new instance is created for each logical "scope" (e.g., per request). Use `NewScopedDependencyInjection`.
```go
func NewScopedDependencyInjection(di *DependencyInjection) *DependencyInjection
```
Expand All @@ -130,7 +130,7 @@ scopedDi := NewScopedDependencyInjection(di)
```

### Transient:
A new instance is created every time the dependency is requested. Use NewTransientDependencyInjection.
A new instance is created every time the dependency is requested. Use `NewTransientDependencyInjection`.
```go
func NewTransientDependencyInjection(di *DependencyInjection) *DependencyInjection
```
Expand All @@ -140,7 +140,7 @@ transientDi := NewTransientDependencyInjection(di)
```

### Pooled:
Maintains a pool of objects that are reused and garbage-collected as needed. Use NewPooledDependencyInjection.
Maintains a pool of objects that are reused and garbage-collected as needed. Use `NewPooledDependencyInjection`.

```go
func NewPooledDependencyInjection(di *DependencyInjection) *DependencyInjection
Expand Down

0 comments on commit 84ec968

Please sign in to comment.