jfrog-client-go
jfrog-client-go copied to clipboard
Correct way to get if a search returned no results?
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.