Skip to content

Commit

Permalink
Fix go lint issues (#825)
Browse files Browse the repository at this point in the history
Co-authored-by: Emir Ribić <e@ribic.ba>
  • Loading branch information
cleptric and ribice committed May 6, 2024
1 parent 3192e9f commit 23c5137
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions transport.go
Expand Up @@ -225,13 +225,15 @@ func envelopeFromBody(event *Event, dsn *Dsn, sentAt time.Time, body json.RawMes
return nil, err
}

if event.Type == transactionType || event.Type == checkInType {
switch event.Type {
case transactionType, checkInType:
err = encodeEnvelopeItem(enc, event.Type, body)
} else if event.Type == metricType {
case metricType:
err = encodeMetric(enc, &b, event.Metrics)
} else {
default:
err = encodeEnvelopeItem(enc, eventType, body)
}

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -658,11 +660,12 @@ func (t *HTTPSyncTransport) SendEventWithContext(ctx context.Context, event *Eve
}

var eventType string
if event.Type == transactionType {
switch {
case event.Type == transactionType:
eventType = "transaction"
} else if event.Type == metricType {
case event.Type == metricType:
eventType = metricType
} else {
default:
eventType = fmt.Sprintf("%s event", event.Level)
}
Logger.Printf(
Expand Down

0 comments on commit 23c5137

Please sign in to comment.