Skip to content

Commit

Permalink
🚨 Ignore naked returns lint errors from new golangci-lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Danieloni1 committed Jun 19, 2023
1 parent 303a959 commit fbddb04
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roomserver/internal/perform/perform_peek.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func (r *Peeker) performPeekRoomByID(
content := map[string]string{}
if err = json.Unmarshal(ev.Content(), &content); err != nil {
util.GetLogger(ctx).WithError(err).Error("json.Unmarshal for history visibility failed")
//nolint: nakedret
return
}
if visibility, ok := content["history_visibility"]; ok {
Expand Down Expand Up @@ -219,6 +220,7 @@ func (r *Peeker) performPeekRoomByID(
},
})
if err != nil {
//nolint: nakedret
return
}

Expand Down
3 changes: 3 additions & 0 deletions syncapi/routing/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func (r *messagesReq) retrieveEvents() (
streamEvents, err := r.snapshot.GetEventsInTopologicalRange(r.ctx, r.from, r.to, r.roomID, r.filter, r.backwardOrdering)
if err != nil {
err = fmt.Errorf("GetEventsInRange: %w", err)
//nolint: nakedret
return
}

Expand All @@ -314,10 +315,12 @@ func (r *messagesReq) retrieveEvents() (
// on the ordering), or we've reached a backward extremity.
if len(streamEvents) == 0 {
if events, err = r.handleEmptyEventsSlice(); err != nil {
//nolint: nakedret
return
}
} else {
if events, err = r.handleNonEmptyEventsSlice(streamEvents); err != nil {
//nolint: nakedret
return
}
}
Expand Down
2 changes: 2 additions & 0 deletions syncapi/streams/stream_pdu.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(

stateEvents, err := snapshot.CurrentState(ctx, roomID, stateFilter, excludingEventIDs)
if err != nil {
//nolint: nakedret
return
}

Expand Down Expand Up @@ -534,6 +535,7 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
}
backwardTopologyPos, backwardStreamPos, err = snapshot.PositionInTopology(ctx, event.EventID())
if err != nil {
//nolint: nakedret
return
}
prevBatch = &types.TopologyToken{
Expand Down
2 changes: 2 additions & 0 deletions userapi/storage/shared/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ func (d *Database) CreateDevice(
for i := 1; i <= 5; i++ {
newDeviceID, returnErr = generateDeviceID()
if returnErr != nil {
//nolint: nakedret
return
}

Expand All @@ -651,6 +652,7 @@ func (d *Database) CreateDevice(
return err
})
if returnErr == nil {
//nolint: nakedret
return
}
}
Expand Down

0 comments on commit fbddb04

Please sign in to comment.