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
feat: add golangci-lint #48
Conversation
main.go
Outdated
cli.ContainerRemove(context.Background(), container.ID, types.ContainerRemoveOptions{RemoveVolumes: true, Force: true}) | ||
err := cli.ContainerRemove(context.Background(), container.ID, types.ContainerRemoveOptions{RemoveVolumes: true, Force: true}) | ||
if err != nil { | ||
log.Println(err) |
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.
Do we want to continue
here to avoid incrementing the number of deleted containers?
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.
If I am nitpicking, I would probably add this in a follow-up bugfix PR, to have a slightly better Git history and keep this PR here focused on the linting change 🙂
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.
Mmmm I think it is actually part of the change: handle the error, which was not handled in the past
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.
Which number of deleted containers we would have before? Probably no output, since it would fail? Or we would have the wrong number?
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.
The error was swallowed, the execution continued adding a container to the map.
Being strict, it could be considered a fix, yeah
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.
But we can also be pragmatic and fix it here. I think having the discussion was more important than the detail where we fix it (as long as we fix it).
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.
I'm unsure what the expected functionality should be at this time, happy to discuss it further in another PR as there are a handful of unhandled errors.
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.
LGTM, although we left a a few comments that need to be addressed before the final approval.
Could you please also resolve the conflicts after recent merges?
Thanks for your time @hhsnopek!
adaa617
to
f910215
Compare
@mdelapenya @kiview I apologize for the force push, but I've resolved the comments which means I've removed the additional error handling/logs in-favor of keeping the scope to adding golangci-lint. |
* main: feat: add golangci-lint (testcontainers#48) chore: add unit tests for Prune function (testcontainers#46) chore(ci): only push Docker image on tags (testcontainers#47) chore: bump build system versions (testcontainers#45) chore: rename branch to main (testcontainers#44)
Context
This pull request introduces
golangci-lint
into the existing CI/CD Pipeline to increase the project's code health. Applyinggo fmt
to all files and fixes a lot of missing error handling.