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

Correct way to get if a search returned no results? #704

Open
Roemer opened this issue Feb 9, 2023 · 0 comments
Open

Correct way to get if a search returned no results? #704

Roemer opened this issue Feb 9, 2023 · 0 comments
Labels
question Further information is requested

Comments

@Roemer
Copy link

Roemer commented Feb 9, 2023

What is the correct way to check if a search found items?

Example (simplified):

searchParams := services.SearchParams{ ... }
artifactoryManager, _ := ...
reader, _ := artifactoryManager.SearchFiles(searchParams)
defer reader.Close()
hasResults := ???

I found the reader.IsEmpty method but that actually always returns false, no matter if there are results or not. No idea what the IsEmpty is supposed to do.
My current bet is, that I should use reader.Length() and if it is > 0, there are obviously search items. Is this the correct way?
Many thanks.

@Roemer Roemer added the question Further information is requested label Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant