diff --git a/runner/options.go b/runner/options.go index 45706b40..99af85ee 100644 --- a/runner/options.go +++ b/runner/options.go @@ -568,13 +568,9 @@ func WithTemplateFuncs(funcMap template.FuncMap) Option { // NewConfig creates a new RunConfig from the options passed func NewConfig(call, host string, options ...Option) (*RunConfig, error) { - call = strings.TrimSpace(call) - host = strings.TrimSpace(host) // init with defaults c := &RunConfig{ - call: call, - host: host, n: 200, c: 50, nConns: 1, @@ -593,6 +589,16 @@ func NewConfig(call, host string, options ...Option) (*RunConfig, error) { } } + // host and call may have been applied via options + // only override if not present + if c.host == "" { + c.host = strings.TrimSpace(host) + } + + if c.call == "" { + c.call = strings.TrimSpace(call) + } + // fix up durations if c.z > 0 { c.n = math.MaxInt32