applyOptions applies the options to the container and validates them.
(c *Container, opts ...Option)
| 31 | |
| 32 | // applyOptions applies the options to the container and validates them. |
| 33 | func applyOptions(c *Container, opts ...Option) error { |
| 34 | for _, opt := range opts { |
| 35 | if err := opt.set(c); err != nil { |
| 36 | return err |
| 37 | } |
| 38 | } |
| 39 | return nil |
| 40 | } |
| 41 | |
| 42 | // ensure all the container identifiers are either empty or unique. |
| 43 | func validateIds(c *Container, seen map[string]bool) error { |