From 582c35f117534c49e953ff29312422d294c1cbc7 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Tue, 18 Jun 2024 01:36:03 +0800 Subject: [PATCH] misc: fix typos in the code (#104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Martin Kolárik --- .gitignore | 2 +- cmd/ping.go | 2 +- view/infinite.go | 8 ++++---- view/infinite_test.go | 2 +- view/summary.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8684cf5..a0aeee6 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,5 @@ coverage.html dist/ -# binaries not commited +# binaries not committed bin/ diff --git a/cmd/ping.go b/cmd/ping.go index c74cbcb..4ce19dc 100644 --- a/cmd/ping.go +++ b/cmd/ping.go @@ -98,7 +98,7 @@ func (r *Root) RunPing(cmd *cobra.Command, args []string) error { func (r *Root) pingInfinite(opts *globalping.MeasurementCreate) error { if r.ctx.Limit > 5 { - return fmt.Errorf("continous mode is currently limited to 5 probes") + return fmt.Errorf("continuous mode is currently limited to 5 probes") } var err error diff --git a/view/infinite.go b/view/infinite.go index 6c90a1e..8c99c7f 100644 --- a/view/infinite.go +++ b/view/infinite.go @@ -45,8 +45,8 @@ func (v *viewer) outputStreamingPackets(m *globalping.Measurement) error { probeMeasurement := &m.Results[0] hm := v.ctx.History.Find(m.ID) if probeMeasurement.Result.RawOutput != "" { - concurentStats := v.aggregateConcurentStats(v.ctx.AggregatedStats[0], 0, m.ID) - parsedOutput := v.parsePingRawOutput(hm, probeMeasurement, concurentStats.Sent) + concurrentStats := v.aggregateConcurrentStats(v.ctx.AggregatedStats[0], 0, m.ID) + parsedOutput := v.parsePingRawOutput(hm, probeMeasurement, concurrentStats.Sent) if len(hm.Stats) == 0 { hm.Stats = make([]*MeasurementStats, 1) } @@ -134,7 +134,7 @@ func (v *viewer) generateTable(hm *HistoryItem, m *globalping.Measurement, areaW parsedOutput := v.parsePingRawOutput(hm, probeMeasurement, -1) newAggregatedStats[i] = mergeMeasurementStats(*v.ctx.AggregatedStats[i], parsedOutput.Stats) newStats[i] = parsedOutput.Stats - row := getRowValues(v.aggregateConcurentStats(newAggregatedStats[i], i, m.ID)) + row := getRowValues(v.aggregateConcurrentStats(newAggregatedStats[i], i, m.ID)) rowWidth := 0 for j := 1; j < len(row); j++ { rowWidth += len(row[j]) + len(colSeparator) @@ -188,7 +188,7 @@ func (v *viewer) generateTable(hm *HistoryItem, m *globalping.Measurement, areaW return &output, newStats, newAggregatedStats } -func (v *viewer) aggregateConcurentStats(completed *MeasurementStats, probeIndex int, excludeId string) *MeasurementStats { +func (v *viewer) aggregateConcurrentStats(completed *MeasurementStats, probeIndex int, excludeId string) *MeasurementStats { inProgressStats := v.ctx.History.FilterByStatus(globalping.StatusInProgress) for i := range inProgressStats { if inProgressStats[i].Id == excludeId { diff --git a/view/infinite_test.go b/view/infinite_test.go index 69c5861..417bff9 100644 --- a/view/infinite_test.go +++ b/view/infinite_test.go @@ -268,7 +268,7 @@ Nuremberg, DE, EU, Hetzner Online GmbH (AS0) | 2 | 0.00% | 4.07 ms | 4. assert.Equal(t, expectedOutput, w.String()) } -func Test_OutputInfinite_MultipleProbes_MultipleConcurentCalls(t *testing.T) { +func Test_OutputInfinite_MultipleProbes_MultipleConcurrentCalls(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() diff --git a/view/summary.go b/view/summary.go index 94a3ed3..7185904 100644 --- a/view/summary.go +++ b/view/summary.go @@ -11,7 +11,7 @@ func (v *viewer) OutputSummary() { } if len(v.ctx.AggregatedStats) == 1 { - stats := v.aggregateConcurentStats(v.ctx.AggregatedStats[0], 0, "") + stats := v.aggregateConcurrentStats(v.ctx.AggregatedStats[0], 0, "") v.printer.Printf("\n--- %s ping statistics ---\n", v.ctx.Hostname) v.printer.Printf("%d packets transmitted, %d received, %.2f%% packet loss, time %.0fms\n",