Skip to content

Commit

Permalink
Fix revive CI issues (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored Jan 10, 2024
1 parent 32f1b19 commit 46c2ed3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (mi *modulesIntegration) SetupOnce(client *Client) {
client.AddEventProcessor(mi.processor)
}

func (mi *modulesIntegration) processor(event *Event, hint *EventHint) *Event {
func (mi *modulesIntegration) processor(event *Event, _ *EventHint) *Event {
if len(event.Modules) == 0 {
mi.once.Do(func() {
info, ok := debug.ReadBuildInfo()
Expand Down Expand Up @@ -70,7 +70,7 @@ func (ei *environmentIntegration) SetupOnce(client *Client) {
client.AddEventProcessor(ei.processor)
}

func (ei *environmentIntegration) processor(event *Event, hint *EventHint) *Event {
func (ei *environmentIntegration) processor(event *Event, _ *EventHint) *Event {
// Initialize maps as necessary.
contextNames := []string{"device", "os", "runtime"}
if event.Contexts == nil {
Expand Down Expand Up @@ -135,7 +135,7 @@ func (iei *ignoreErrorsIntegration) SetupOnce(client *Client) {
client.AddEventProcessor(iei.processor)
}

func (iei *ignoreErrorsIntegration) processor(event *Event, hint *EventHint) *Event {
func (iei *ignoreErrorsIntegration) processor(event *Event, _ *EventHint) *Event {
suspects := getIgnoreErrorsSuspects(event)

for _, suspect := range suspects {
Expand Down Expand Up @@ -195,7 +195,7 @@ func (iei *ignoreTransactionsIntegration) SetupOnce(client *Client) {
client.AddEventProcessor(iei.processor)
}

func (iei *ignoreTransactionsIntegration) processor(event *Event, hint *EventHint) *Event {
func (iei *ignoreTransactionsIntegration) processor(event *Event, _ *EventHint) *Event {
suspect := event.Transaction
if suspect == "" {
return event
Expand Down Expand Up @@ -233,7 +233,7 @@ func (cfi *contextifyFramesIntegration) SetupOnce(client *Client) {
client.AddEventProcessor(cfi.processor)
}

func (cfi *contextifyFramesIntegration) processor(event *Event, hint *EventHint) *Event {
func (cfi *contextifyFramesIntegration) processor(event *Event, _ *EventHint) *Event {
// Range over all exceptions
for _, ex := range event.Exception {
// If it has no stacktrace, just bail out
Expand Down Expand Up @@ -353,7 +353,7 @@ func (ti *globalTagsIntegration) SetupOnce(client *Client) {
client.AddEventProcessor(ti.processor)
}

func (ti *globalTagsIntegration) processor(event *Event, hint *EventHint) *Event {
func (ti *globalTagsIntegration) processor(event *Event, _ *EventHint) *Event {
if len(ti.tags) == 0 && len(ti.envTags) == 0 {
return event
}
Expand Down
2 changes: 1 addition & 1 deletion internal/testutils/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func formatUnequalValues(got, want interface{}) string {
return fmt.Sprintf("\ngot: %s\nwant: %s", a, b)
}

func AssertBaggageStringsEqual(t *testing.T, got, want string, userMessage ...interface{}) {
func AssertBaggageStringsEqual(t *testing.T, got, want string) {
t.Helper()

baggageGot, err := baggage.Parse(got)
Expand Down
2 changes: 1 addition & 1 deletion martini/sentrymartini.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func New(options Options) martini.Handler {
}).handle
}

func (h *handler) handle(rw http.ResponseWriter, r *http.Request, ctx martini.Context) {
func (h *handler) handle(_ http.ResponseWriter, r *http.Request, ctx martini.Context) {
hub := sentry.GetHubFromContext(r.Context())
if hub == nil {
hub = sentry.CurrentHub().Clone()
Expand Down
8 changes: 4 additions & 4 deletions mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ type ScopeMock struct {
shouldDropEvent bool
}

func (scope *ScopeMock) AddBreadcrumb(breadcrumb *Breadcrumb, limit int) {
func (scope *ScopeMock) AddBreadcrumb(breadcrumb *Breadcrumb, _ int) {
scope.breadcrumb = breadcrumb
}

func (scope *ScopeMock) ApplyToEvent(event *Event, hint *EventHint) *Event {
func (scope *ScopeMock) ApplyToEvent(event *Event, _ *EventHint) *Event {
if scope.shouldDropEvent {
return nil
}
Expand All @@ -27,14 +27,14 @@ type TransportMock struct {
lastEvent *Event
}

func (t *TransportMock) Configure(options ClientOptions) {}
func (t *TransportMock) Configure(_ ClientOptions) {}
func (t *TransportMock) SendEvent(event *Event) {
t.mu.Lock()
defer t.mu.Unlock()
t.events = append(t.events, event)
t.lastEvent = event
}
func (t *TransportMock) Flush(timeout time.Duration) bool {
func (t *TransportMock) Flush(_ time.Duration) bool {
return true
}
func (t *TransportMock) Events() []*Event {
Expand Down
2 changes: 1 addition & 1 deletion scope_concurrency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/getsentry/sentry-go"
)

func TestConcurrentScopeUsage(t *testing.T) {
func TestConcurrentScopeUsage(_ *testing.T) {
var wg sync.WaitGroup

for i := 0; i < 10; i++ {
Expand Down
8 changes: 4 additions & 4 deletions tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func TestContinueSpanFromTrace(t *testing.T) {
}
}

func TestSpanFromContext(t *testing.T) {
func TestSpanFromContext(_ *testing.T) {
// SpanFromContext always returns a non-nil value, such that you can use
// it without nil checks.
// When no span was in the context, the returned value is a no-op.
Expand Down Expand Up @@ -697,7 +697,7 @@ func TestSample(t *testing.T) {
}
}

func TestDoesNotCrashWithEmptyContext(t *testing.T) {
func TestDoesNotCrashWithEmptyContext(_ *testing.T) {
// This test makes sure that we can still start and finish transactions
// with empty context (for example, when Sentry SDK is not initialized)
ctx := context.Background()
Expand Down Expand Up @@ -884,7 +884,7 @@ func TestSpanSetContextOverrides(t *testing.T) {
// This test checks that there are no concurrent reads/writes to
// substructures in scope.contexts.
// See https://github.com/getsentry/sentry-go/issues/570 for more details.
func TestConcurrentContextAccess(t *testing.T) {
func TestConcurrentContextAccess(_ *testing.T) {
ctx := NewTestContext(ClientOptions{
EnableTracing: true,
TracesSampleRate: 1,
Expand Down Expand Up @@ -973,7 +973,7 @@ func TestAdjustingTransactionSourceBeforeSending(t *testing.T) {
// This is a regression test for https://github.com/getsentry/sentry-go/issues/587
// Without the "spans can be finished only once" fix, this test will fail
// when run with race detection ("-race").
func TestSpanFinishConcurrentlyWithoutRaces(t *testing.T) {
func TestSpanFinishConcurrentlyWithoutRaces(_ *testing.T) {
ctx := NewTestContext(ClientOptions{
EnableTracing: true,
TracesSampleRate: 1,
Expand Down

0 comments on commit 46c2ed3

Please sign in to comment.