(opts ...Option)
| 154 | } |
| 155 | |
| 156 | func applyOptions(opts ...Option) (engineConfig, error) { |
| 157 | cfg := engineConfig{ |
| 158 | autogen: defaultAutogenPolicy(), |
| 159 | seriesSelection: seriesSelectionLastSuccessOnly, |
| 160 | } |
| 161 | for i, opt := range opts { |
| 162 | if opt == nil { |
| 163 | continue |
| 164 | } |
| 165 | if err := opt(&cfg); err != nil { |
| 166 | return engineConfig{}, fmt.Errorf("chartengine: option[%d]: %w", i, err) |
| 167 | } |
| 168 | } |
| 169 | return cfg, nil |
| 170 | } |
no test coverage detected
searching dependent graphs…