Skip to content

Commit 43694fc

Browse files
committed
chore: pretty format the console output
1 parent 0da9305 commit 43694fc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cmd/nginx-supportpkg.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os"
2424
"path/filepath"
2525
"slices"
26+
"strings"
2627
"time"
2728

2829
"github.com/nginxinc/nginx-k8s-supportpkg/pkg/data_collector"
@@ -70,10 +71,16 @@ func Execute() {
7071
failedJobs := 0
7172
totalJobs := len(jobList)
7273
var jobTimings []data_collector.JobInfo
74+
const jobNameWidth = 30
7375

7476
for _, job := range jobList {
75-
fmt.Printf("Running job %s...", job.Name)
76-
77+
fmt.Printf("Running job %s", job.Name)
78+
// Calculate number of dots needed
79+
dots := jobNameWidth - len(job.Name)
80+
if dots < 0 {
81+
dots = 0
82+
}
83+
fmt.Printf("%s ", strings.Repeat(".", dots))
7784
// Record job start and end time to calculate duration
7885
jobStartTime := time.Now()
7986
err, skipped, files := job.Collect(&collector)

0 commit comments

Comments
 (0)