(ctx context.Context)
| 237 | } |
| 238 | |
| 239 | func (a *API) getConfig(ctx context.Context) *conf.Configuration { |
| 240 | obj := ctx.Value(configKey) |
| 241 | if obj == nil { |
| 242 | return nil |
| 243 | } |
| 244 | |
| 245 | config := obj.(*conf.Configuration) |
| 246 | |
| 247 | extConfig := (*a.config).External |
| 248 | if err := mergo.MergeWithOverwrite(&extConfig, config.External); err != nil { |
| 249 | return nil |
| 250 | } |
| 251 | config.External = extConfig |
| 252 | |
| 253 | smtpConfig := (*a.config).SMTP |
| 254 | if err := mergo.MergeWithOverwrite(&smtpConfig, config.SMTP); err != nil { |
| 255 | return nil |
| 256 | } |
| 257 | config.SMTP = smtpConfig |
| 258 | |
| 259 | return config |
| 260 | } |
no test coverage detected