Skip to content

Commit

Permalink
docs: Run go fmt (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Oct 31, 2022
1 parent e78f722 commit bf68bd2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
11 changes: 6 additions & 5 deletions doc.go
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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/.
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dsn_test.go
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions stacktrace_external_test.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stacktrace_test.go
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions tracing.go
Expand Up @@ -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
Expand Down Expand Up @@ -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"))
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion util.go
Expand Up @@ -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))
Expand Down

0 comments on commit bf68bd2

Please sign in to comment.