diff --git a/driver.go b/driver.go index 0499228..4f262bd 100644 --- a/driver.go +++ b/driver.go @@ -139,13 +139,13 @@ func newConnConfig(opts driverOptions) connConfig { metric.WithUnit(unitMilliseconds), metric.WithDescription(`The distribution of latencies of various calls in milliseconds`), ) - mustHandleErr(err) + mustNoError(err) callsCounter, err := meter.Int64Counter(dbSQLClientCalls, metric.WithUnit(unitDimensionless), metric.WithDescription(`The number of various calls of methods`), ) - mustHandleErr(err) + mustNoError(err) latencyRecorder := newMethodRecorder(latencyMsHistogram.Record, callsCounter.Add, opts.defaultAttributes...) diff --git a/errors.go b/errors.go index 661f90b..f96f9a5 100644 --- a/errors.go +++ b/errors.go @@ -8,7 +8,7 @@ func handleErr(err error) { } } -func mustHandleErr(err error) { +func mustNoError(err error) { if err != nil { panic(err) } diff --git a/errors_internal_test.go b/errors_internal_test.go index e053955..652686c 100644 --- a/errors_internal_test.go +++ b/errors_internal_test.go @@ -11,11 +11,11 @@ func TestHandleError(t *testing.T) { t.Parallel() assert.Panics(t, func() { - mustHandleErr(errors.New("error")) + mustNoError(errors.New("error")) }) assert.NotPanics(t, func() { - mustHandleErr(nil) + mustNoError(nil) }) assert.NotPanics(t, func() {