fix sets multiple --output-http parameters to take effect only one #1097
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This function is called when the outhttp plugin is registered in the loop, passing a pointer type to &Settings.OutputHTTPConfig
https://github.com/buger/goreplay/blob/master/plugins.go#L145
for _, options := range Settings.OutputHTTP { plugins.registerPlugin(NewHTTPOutput, options, &Settings.OutputHTTPConfig) }
parsing the address to generate the url directly overrides the &Settings.OutputHTTPConfig.url field,which will cause multiple calls to overwrite the same &Settings.OutputHTTPConfig.url field
https://github.com/buger/goreplay/blob/master/output_http.go#L71
config.url, err = url.Parse(address)
Multiple HTTPOutputs point to the same &Settings.OutputHTTPConfig, resulting in the last --output-http parameter value overwriting the previously set value.
https://github.com/buger/goreplay/blob/master/output_http.go#L106
o.config = config