From 38efc875cf1c9e9ae72d3021b0a813ed7fa3ce00 Mon Sep 17 00:00:00 2001 From: Leon Wang Date: Fri, 5 Feb 2021 03:32:43 +0800 Subject: [PATCH] Code Improvement - Error strings should not be capitalized (#1488) Co-authored-by: Tyler Yahn --- exporters/otlp/otlphttp/driver.go | 4 ++-- metric/registry/registry.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exporters/otlp/otlphttp/driver.go b/exporters/otlp/otlphttp/driver.go index 0de13bfd0..b24cab696 100644 --- a/exporters/otlp/otlphttp/driver.go +++ b/exporters/otlp/otlphttp/driver.go @@ -193,10 +193,10 @@ func (d *driver) send(ctx context.Context, rawRequest []byte, urlPath string) er return ctx.Err() } default: - return fmt.Errorf("Failed with HTTP status %s", response.Status) + return fmt.Errorf("failed with HTTP status %s", response.Status) } } - return fmt.Errorf("Failed to send data to %s after %d tries", address, d.cfg.maxAttempts) + return fmt.Errorf("failed to send data to %s after %d tries", address, d.cfg.maxAttempts) } func (d *driver) getScheme() string { diff --git a/metric/registry/registry.go b/metric/registry/registry.go index f1d9819c3..955ba050e 100644 --- a/metric/registry/registry.go +++ b/metric/registry/registry.go @@ -63,7 +63,7 @@ func (p *MeterProvider) Meter(instrumentationName string, opts ...metric.MeterOp // ErrMetricKindMismatch is the standard error for mismatched metric // instrument definitions. var ErrMetricKindMismatch = fmt.Errorf( - "A metric was already registered by this name with another kind or number type") + "a metric was already registered by this name with another kind or number type") // NewUniqueInstrumentMeterImpl returns a wrapped metric.MeterImpl with // the addition of uniqueness checking. @@ -90,7 +90,7 @@ func keyOf(descriptor metric.Descriptor) key { // NewMetricKindMismatchError formats an error that describes a // mismatched metric instrument definition. func NewMetricKindMismatchError(desc metric.Descriptor) error { - return fmt.Errorf("Metric was %s (%s %s)registered as a %s %s: %w", + return fmt.Errorf("metric was %s (%s %s)registered as a %s %s: %w", desc.Name(), desc.InstrumentationName(), desc.InstrumentationVersion(),