Since container.Create() already initializes HostConfig
to be non-nil, there is no need for this code. Remove it.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
| ... | ... |
@@ -128,17 +128,11 @@ func WithIPv6(network, ip string) func(*TestContainerConfig) {
|
| 128 | 128 |
// WithLogDriver sets the log driver to use for the container |
| 129 | 129 |
func WithLogDriver(driver string) func(*TestContainerConfig) {
|
| 130 | 130 |
return func(c *TestContainerConfig) {
|
| 131 |
- if c.HostConfig == nil {
|
|
| 132 |
- c.HostConfig = &containertypes.HostConfig{}
|
|
| 133 |
- } |
|
| 134 | 131 |
c.HostConfig.LogConfig.Type = driver |
| 135 | 132 |
} |
| 136 | 133 |
} |
| 137 | 134 |
|
| 138 | 135 |
// WithAutoRemove sets the container to be removed on exit |
| 139 | 136 |
func WithAutoRemove(c *TestContainerConfig) {
|
| 140 |
- if c.HostConfig == nil {
|
|
| 141 |
- c.HostConfig = &containertypes.HostConfig{}
|
|
| 142 |
- } |
|
| 143 | 137 |
c.HostConfig.AutoRemove = true |
| 144 | 138 |
} |