Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return empty slice instead of null when there is no user activity #77

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (db *DB) Query(ctx context.Context, statement string,
return err
}

var rows []interface{}
rows := []interface{}{}
for results.Next() {
var row interface{}
err := results.Row(&row)
Expand Down
3 changes: 0 additions & 3 deletions internal/user/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ func (s service) Activities(ctx context.Context, id string, offset, limit int) (
if err != nil {
return nil, err
}
// if len(result) == 0 {
// return make([]interface{}, 0), nil
// }
return result, nil
}

Expand Down
Loading