Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Sep 8, 2023
1 parent ddcc47a commit d84314a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions bbolt/state_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (s *State) SetDateSeq(_ context.Context, userID int64, date, seq int) error
})
}

func (s *State) GetChannelPts(_ context.Context, userID, channelID int64) (int, bool, error) {
func (s *State) GetChannelPts(_ context.Context, userID, channelID int64) (pts int, found bool, err error) {
tx, err := s.db.Begin(false)
if err != nil {
return 0, false, err
Expand All @@ -192,12 +192,12 @@ func (s *State) GetChannelPts(_ context.Context, userID, channelID int64) (int,
return 0, false, nil
}

pts := channels.Get(i642b(channelID))
if pts == nil {
p := channels.Get(i642b(channelID))
if p == nil {
return 0, false, nil
}

return b2i(pts), true, nil
return b2i(p), true, nil
}

func (s *State) SetChannelPts(_ context.Context, userID, channelID int64, pts int) error {
Expand Down
2 changes: 1 addition & 1 deletion pebble/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (p pebbleStorage) Set(ctx context.Context, k, v string) (rerr error) {
d := b.SetDeferred(len(k), len(v))
copy(d.Key, k)
copy(d.Value, v)
d.Finish()
_ = d.Finish()

return b.Commit(p.opts)
}
Expand Down
4 changes: 2 additions & 2 deletions pebble/peer_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ func (s PeerStorage) add(associated []string, value storage.Peer) (rerr error) {
set := b.SetDeferred(len(id), len(data))
copy(set.Key, id)
copy(set.Value, data)
set.Finish()
_ = set.Finish()

for _, key := range associated {
deferred := b.SetDeferred(len(key), len(id))
copy(deferred.Key, key)
copy(deferred.Value, id)
deferred.Finish()
_ = deferred.Finish()
}

if err := b.Commit(nil); err != nil {
Expand Down

0 comments on commit d84314a

Please sign in to comment.