fix(container): add to nil modifiers#112
Merged
mdelapenya merged 1 commit intodocker:mainfrom Oct 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the WithAdditional*Modifier functions to handle nil original modifiers instead of returning an error. When the original modifier is nil, the new modifier is now directly applied rather than treating it as an error condition.
Key changes:
- Removed error returns when original modifiers are nil
- Added nil checks to apply the new modifier directly when no original exists
- Added test coverage for the nil original modifier scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| container/options.go | Updated three WithAdditional*Modifier functions to handle nil original modifiers by applying only the new modifier |
| container/options_test.go | Added "nil-original" test cases for each of the three modifier functions to verify the new behavior |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
mdelapenya
added a commit
to ndeloof/go-sdk
that referenced
this pull request
Nov 6, 2025
* main: feat(wait): add human-readable String() methods to all wait strategies (docker#119) feat(image): display formatted pull progress on Windows terminals (docker#118) chore(release): add Go proxy refresh automation (docker#117) chore(release): bump module versions chore(release): prevent for pushing to personal forks (docker#115) chore(release): add pre-release checks to make the release process more consistent (docker#114) chore(volume): return pointer in FindByID (docker#105) fix(container): proper error message on empty container names (docker#113) fix(container): add to nil modifiers (docker#112) feat(container): add new functional options to add container config, hostConfig and endpointSettings (docker#111) feat(container): configure pull handler at container creation (docker#110)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
It sets the current modifier as the modifier if the original one was nil
Why is it important?
Avoid errors and simplify initialisation in client code