@@ -50,11 +50,11 @@ func TaskMainQueue(tqs *queue.TaskQueueSet, format string) interface{} {
5050
5151 if format == "text" {
5252 var buf strings.Builder
53- buf . WriteString ( fmt .Sprintf ( "Queue '%s': length %d, status: '%s'\n " , dq .Name , dq .TasksCount , dq .Status ) )
53+ fmt .Fprintf ( & buf , "Queue '%s': length %d, status: '%s'\n " , dq .Name , dq .TasksCount , dq .Status )
5454 buf .WriteString ("\n " )
5555
5656 for _ , ts := range dq .Tasks {
57- buf . WriteString ( fmt .Sprintf ( "%2d. " , ts .Index ) )
57+ fmt .Fprintf ( & buf , "%2d. " , ts .Index )
5858 buf .WriteString (ts .Description )
5959 buf .WriteString ("\n " )
6060 }
@@ -264,21 +264,21 @@ func (dtq dumpTaskQueues) asText(showEmpty bool) string {
264264 buf .WriteString ("\n " )
265265 }
266266
267- buf . WriteString ( fmt .Sprintf ( "Queue '%s': length %d, status: '%s'\n " , taskQueue .Name , taskQueue .TasksCount , taskQueue .Status ) )
267+ fmt .Fprintf ( & buf , "Queue '%s': length %d, status: '%s'\n " , taskQueue .Name , taskQueue .TasksCount , taskQueue .Status )
268268 buf .WriteString ("\n " )
269269
270270 for _ , tk := range taskQueue .Tasks {
271- buf . WriteString ( fmt .Sprintf ( "%2d. " , tk .Index ) )
271+ fmt .Fprintf ( & buf , "%2d. " , tk .Index )
272272 buf .WriteString (tk .Description )
273273 buf .WriteString ("\n " )
274274 }
275275 }
276276
277277 // Empty queues. Do not report single empty main queue.
278278 if showEmpty {
279- buf . WriteString ( fmt .Sprintf ( "\n Empty queues (%d):\n " , len (dtq .Empty ) ))
279+ fmt .Fprintf ( & buf , "\n Empty queues (%d):\n " , len (dtq .Empty ))
280280 for _ , taskQueue := range dtq .Empty {
281- buf . WriteString ( fmt .Sprintf ( "- %s\n " , taskQueue .Name ) )
281+ fmt .Fprintf ( & buf , "- %s\n " , taskQueue .Name )
282282 }
283283 }
284284
@@ -300,22 +300,22 @@ func (dtq dumpTaskQueues) asText(showEmpty bool) string {
300300 buf .WriteString ("Summary:\n " )
301301 if dtq .MainQueue != nil {
302302 otherQueuesCount -- // minus main queue
303- buf . WriteString ( fmt .Sprintf ( "- '%s' queue: %s.\n " ,
303+ fmt .Fprintf ( & buf , "- '%s' queue: %s.\n " ,
304304 dtq .MainQueue .Name ,
305- pluralize (len (dtq .MainQueue .Tasks ), "empty" , "task" , "tasks" )))
305+ pluralize (len (dtq .MainQueue .Tasks ), "empty" , "task" , "tasks" ))
306306 }
307307
308308 if otherQueuesCount > 0 {
309- buf . WriteString ( fmt .Sprintf ( "- %s (%d active, %d empty): %s.\n " ,
309+ fmt .Fprintf ( & buf , "- %s (%d active, %d empty): %s.\n " ,
310310 pluralize (otherQueuesCount , "" , "other queue" , "other queues" ),
311311 dtq .Summary .otherQueuesActiveCount , dtq .Summary .otherQueuesEmptyCount ,
312- pluralize (dtq .Summary .otherQueuesTasksCount , "" , "task" , "tasks" )))
312+ pluralize (dtq .Summary .otherQueuesTasksCount , "" , "task" , "tasks" ))
313313 }
314314 if dtq .Summary .totalTasksCount == 0 {
315315 buf .WriteString ("- no tasks to handle.\n " )
316316 } else {
317- buf . WriteString ( fmt .Sprintf ( "- total %s to handle.\n " ,
318- pluralize (dtq .Summary .totalTasksCount , "" , "task" , "tasks" )))
317+ fmt .Fprintf ( & buf , "- total %s to handle.\n " ,
318+ pluralize (dtq .Summary .totalTasksCount , "" , "task" , "tasks" ))
319319 }
320320 }
321321
0 commit comments