From d63451b95b7ff2f049d61edb7b9dd662e6f1c8ae Mon Sep 17 00:00:00 2001 From: Paul Bauer Date: Wed, 25 Nov 2020 14:30:18 -0500 Subject: [PATCH] gofmt fixes --- profiler/profile.go | 10 +++++----- profiler/profiler.go | 2 +- profiler/upload_test.go | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/profiler/profile.go b/profiler/profile.go index 00faaff97a..ede4f51c30 100644 --- a/profiler/profile.go +++ b/profiler/profile.go @@ -100,7 +100,7 @@ func heapProfile(cfg *config) (*profile, error) { cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1) return &profile{ name: "heap", - data: buf.Bytes(), + data: buf.Bytes(), }, nil } @@ -124,7 +124,7 @@ func cpuProfile(cfg *config) (*profile, error) { cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1) return &profile{ name: "cpu", - data: buf.Bytes(), + data: buf.Bytes(), }, nil } @@ -149,7 +149,7 @@ func blockProfile(cfg *config) (*profile, error) { cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1) return &profile{ name: "block", - data: buf.Bytes(), + data: buf.Bytes(), }, nil } @@ -164,7 +164,7 @@ func mutexProfile(cfg *config) (*profile, error) { cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1) return &profile{ name: "mutex", - data: buf.Bytes(), + data: buf.Bytes(), }, nil } @@ -179,7 +179,7 @@ func goroutineProfile(cfg *config) (*profile, error) { cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1) return &profile{ name: "goroutines", - data: buf.Bytes(), + data: buf.Bytes(), }, nil } diff --git a/profiler/profiler.go b/profiler/profiler.go index 1a3ca44d31..11f55ee939 100644 --- a/profiler/profiler.go +++ b/profiler/profiler.go @@ -134,7 +134,7 @@ func (p *profiler) collect(ticker <-chan time.Time) { // record the actual start and end timestamps for the batch, // it is how the backend understands the client-side // configured CPU profile duration: (start-end). - end: now.Add(p.cfg.cpuDuration), + end: now.Add(p.cfg.cpuDuration), } for t := range p.cfg.types { prof, err := p.runProfile(t) diff --git a/profiler/upload_test.go b/profiler/upload_test.go index 97332ee5e1..8c62d09ef0 100644 --- a/profiler/upload_test.go +++ b/profiler/upload_test.go @@ -35,11 +35,11 @@ var testBatch = batch{ profiles: []*profile{ { name: "cpu", - data: []byte("my-cpu-profile"), + data: []byte("my-cpu-profile"), }, { name: "heap", - data: []byte("my-heap-profile"), + data: []byte("my-heap-profile"), }, }, } @@ -80,10 +80,10 @@ func TestTryUpload(t *testing.T) { fmt.Sprintf("runtime-id:%s", globalconfig.RuntimeID()), }, tags) for k, v := range map[string]string{ - "version": "3", - "family": "go", + "version": "3", + "family": "go", "data[cpu.pprof]": "my-cpu-profile", - "data[heap.pprof]": "my-heap-profile", + "data[heap.pprof]": "my-heap-profile", } { assert.Equal(v, fields[k], k) } @@ -162,7 +162,7 @@ func BenchmarkDoRequest(b *testing.B) { defer srv.Close() prof := profile{ name: "heap", - data: []byte("my-heap-profile"), + data: []byte("my-heap-profile"), } bat := batch{ start: time.Now().Add(-10 * time.Second),