@@ -22,6 +22,7 @@ import (
2222 "encoding/json"
2323 "errors"
2424 "fmt"
25+ "maps"
2526 "net/url"
2627 "os"
2728 "strconv"
@@ -112,7 +113,7 @@ func runServerBenchmark(ctx *cli.Context, b bench.Benchmark) (bool, error) {
112113 if len (conns .hosts ) == 0 {
113114 return true , errors .New ("no hosts" )
114115 }
115- infoLn := func (data ... interface {} ) {
116+ infoLn := func (data ... any ) {
116117 ui .SetSubText (strings .TrimRight (fmt .Sprintln (data ... ), "\r \n ." ))
117118 }
118119
@@ -174,9 +175,7 @@ func runServerBenchmark(ctx *cli.Context, b bench.Benchmark) (bool, error) {
174175 }
175176 }
176177 }
177- for k , v := range b .GetCommon ().ExtraFlags {
178- req .Benchmark .Flags [k ] = v
179- }
178+ maps .Copy (req .Benchmark .Flags , b .GetCommon ().ExtraFlags )
180179
181180 // Connect to hosts, send benchmark requests.
182181 ui .StartPrepare ("Preparing" , nil , nil )
@@ -349,8 +348,8 @@ func runServerBenchmark(ctx *cli.Context, b bench.Benchmark) (bool, error) {
349348
350349// connections keeps track of connections to clients.
351350type connections struct {
352- info func (data ... interface {} )
353- errLn func (data ... interface {} )
351+ info func (data ... any )
352+ errLn func (data ... any )
354353 hosts []string
355354 ws []* websocket.Conn
356355 si serverInfo
@@ -369,7 +368,7 @@ func newConnections(hosts []string) *connections {
369368 return & c
370369}
371370
372- func (c * connections ) errorF (format string , data ... interface {} ) {
371+ func (c * connections ) errorF (format string , data ... any ) {
373372 c .errLn (fmt .Sprintf (format , data ... ))
374373}
375374
@@ -700,9 +699,7 @@ func (c *connections) waitForStage(ctx context.Context, stage benchmarkStage, fa
700699 if common .Custom == nil {
701700 common .Custom = make (map [string ]string , len (resp .StageInfo .Custom ))
702701 }
703- for k , v := range resp .StageInfo .Custom {
704- common .Custom [k ] = v
705- }
702+ maps .Copy (common .Custom , resp .StageInfo .Custom )
706703 mu .Unlock ()
707704 }
708705 c .info ("Client" , c .hostName (i ), ": Finished stage" , stage , "..." )
0 commit comments