-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor and test GetDatasetDetailsPublished
#66
base: main
Are you sure you want to change the base?
Conversation
if err != nil { | ||
log.Fatal("Get dataset details failed:", err) | ||
} | ||
defer resp.Body.Close() | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra tab
|
||
_ = json.Unmarshal(body, &datasetDetails) | ||
func makeRequest(client *http.Client, APIServer string, filter string) (*http.Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels like this makeRequest
and createFilter
is in many files. If they share most of the logic, would it make sense to move them in the utils
file and import accordingly?
log.Printf("Dataset %s no infos found in catalog - will not be copied !\n", datasetId) | ||
color.Unset() | ||
} | ||
func processDatasetDetails(resp *http.Response, datasetList []string) ([]Dataset, []string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this block very similar to this? If so, in a later PR, we can reuse a common function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carlo's comments about code repetition can be done in a future PR imo.
@consolethinks if you have any free time, could you check and fix this PR (or close it all together if not relevant to your changes)? |
No description provided.