From bf68bd2850b28c05edc3d1ac5589b5fd40ccecbb Mon Sep 17 00:00:00 2001 From: Michi Hoffmann Date: Mon, 31 Oct 2022 10:45:37 +0100 Subject: [PATCH] docs: Run go fmt (#487) --- doc.go | 11 ++++++----- dsn_test.go | 4 ++-- stacktrace_external_test.go | 4 ++-- stacktrace_test.go | 4 ++-- tracing.go | 13 +++++++------ util.go | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/doc.go b/doc.go index 1cc5e94bb..f80fd4024 100644 --- a/doc.go +++ b/doc.go @@ -7,7 +7,7 @@ tracing. For more information about Sentry and SDK features please have a look at the documentation site https://docs.sentry.io/platforms/go/. -Basic Usage +# Basic Usage The first step is to initialize the SDK, providing at a minimum the DSN of your Sentry project. This step is accomplished through a call to sentry.Init. @@ -20,7 +20,7 @@ Sentry project. This step is accomplished through a call to sentry.Init. A more detailed yet simple example is available at https://github.com/getsentry/sentry-go/blob/master/example/basic/main.go. -Error Reporting +# Error Reporting The Capture* functions report messages and errors to Sentry. @@ -31,7 +31,7 @@ The Capture* functions report messages and errors to Sentry. Use similarly named functions in the Hub for concurrent programs like web servers. -Performance Monitoring +# Performance Monitoring You can use Sentry to monitor your application's performance. More information on the product page https://docs.sentry.io/product/performance/. @@ -42,15 +42,16 @@ The StartSpan function creates new spans. ... span.Finish() -Integrations +# Integrations The SDK has support for several Go frameworks, available as subpackages. -Getting Support +# Getting Support For paid Sentry.io accounts, head out to https://sentry.io/support. For all users, support channels include: + Forum: https://forum.sentry.io Discord: https://discord.gg/Ww9hbqr (#go channel) diff --git a/dsn_test.go b/dsn_test.go index 91536cea4..f7f6b8007 100644 --- a/dsn_test.go +++ b/dsn_test.go @@ -57,7 +57,7 @@ var dsnTests = map[string]DsnTest{ }, } -//nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 +// nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 func TestNewDsn(t *testing.T) { for name, tt := range dsnTests { t.Run(name, func(t *testing.T) { @@ -104,7 +104,7 @@ var invalidDsnTests = map[string]invalidDsnTest{ "TrailingSlash": {"https://public:secret@domain:8888/42/", "empty project id"}, } -//nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 +// nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 func TestNewDsnInvalidInput(t *testing.T) { for name, tt := range invalidDsnTests { t.Run(name, func(t *testing.T) { diff --git a/stacktrace_external_test.go b/stacktrace_external_test.go index 8c058ac70..4b609a8b5 100644 --- a/stacktrace_external_test.go +++ b/stacktrace_external_test.go @@ -49,7 +49,7 @@ func BlueGoErrorsRanger() error { return goErrors.New("this is bad from goErrors") } -//nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 +// nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 func TestNewStacktrace(t *testing.T) { tests := map[string]struct { f func() *sentry.Stacktrace @@ -108,7 +108,7 @@ func TestNewStacktrace(t *testing.T) { } } -//nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 +// nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 func TestExtractStacktrace(t *testing.T) { tests := map[string]struct { f func() error diff --git a/stacktrace_test.go b/stacktrace_test.go index 33bed0545..c49650a72 100644 --- a/stacktrace_test.go +++ b/stacktrace_test.go @@ -23,7 +23,7 @@ func BenchmarkNewStacktrace(b *testing.B) { } } -//nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 +// nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 func TestSplitQualifiedFunctionName(t *testing.T) { tests := []struct { in string @@ -67,7 +67,7 @@ func TestSplitQualifiedFunctionName(t *testing.T) { } } -//nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 +// nolint: scopelint // false positive https://github.com/kyoh86/scopelint/issues/4 func TestFilterFrames(t *testing.T) { tests := []struct { in []Frame diff --git a/tracing.go b/tracing.go index 77666d4b5..118699b04 100644 --- a/tracing.go +++ b/tracing.go @@ -228,13 +228,13 @@ func (s *Span) ToSentryTrace() string { // sentryTracePattern matches either // -// TRACE_ID - SPAN_ID -// [[:xdigit:]]{32}-[[:xdigit:]]{16} +// TRACE_ID - SPAN_ID +// [[:xdigit:]]{32}-[[:xdigit:]]{16} // // or // -// TRACE_ID - SPAN_ID - SAMPLED -// [[:xdigit:]]{32}-[[:xdigit:]]{16}-[01] +// TRACE_ID - SPAN_ID - SAMPLED +// [[:xdigit:]]{32}-[[:xdigit:]]{16}-[01] var sentryTracePattern = regexp.MustCompile(`^([[:xdigit:]]{32})-([[:xdigit:]]{16})(?:-([01]))?$`) // updateFromSentryTrace parses a sentry-trace HTTP header (as returned by @@ -579,7 +579,8 @@ func OpName(name string) SpanOption { // span will be left unchanged. // // ContinueFromRequest is an alias for: -// ContinueFromTrace(r.Header.Get("sentry-trace")) +// +// ContinueFromTrace(r.Header.Get("sentry-trace")) func ContinueFromRequest(r *http.Request) SpanOption { return ContinueFromTrace(r.Header.Get("sentry-trace")) } @@ -619,7 +620,7 @@ func TransactionFromContext(ctx context.Context) *Span { // // Note the equivalence: // -// SpanFromContext(ctx).StartChild(...) === StartSpan(ctx, ...) +// SpanFromContext(ctx).StartChild(...) === StartSpan(ctx, ...) // // So we don't aim spanFromContext at creating spans, but mutating existing // spans that you'd have no access otherwise (because it was created in code you diff --git a/util.go b/util.go index b523f5d11..e5717c631 100644 --- a/util.go +++ b/util.go @@ -35,7 +35,7 @@ func monotonicTimeSince(start time.Time) (end time.Time) { return start.Add(time.Since(start)) } -//nolint: deadcode, unused +// nolint: deadcode, unused func prettyPrint(data interface{}) { dbg, _ := json.MarshalIndent(data, "", " ") fmt.Println(string(dbg))