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 array instead of null when tasks list is empty #115

Merged
merged 1 commit into from
Aug 18, 2016
Merged

Return empty array instead of null when tasks list is empty #115

merged 1 commit into from
Aug 18, 2016

Conversation

sheepkiller
Copy link

go lint doesn't like it, but it's nicer for clients

@sheepkiller
Copy link
Author

Hi,

Another option is to return "make([]*types.EremeticTask, 0)" in ListRunningTasks() if database backend returns nothing

@alde
Copy link
Contributor

alde commented Aug 18, 2016

You should also be able to do

tasks := []*types.EremeticTask{}

I think, which makes go lint happy

I did this in https://github.com/alde/physical/blob/master/physical.go#L89

@sheepkiller
Copy link
Author

hi @alde,

nice. thanks you !

@keis
Copy link
Collaborator

keis commented Aug 18, 2016

LGTM

@keis keis merged commit 0efce4a into eremetic-framework:master Aug 18, 2016
@sheepkiller sheepkiller deleted the return_empty_array_for_tasks branch August 18, 2016 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants