Merged
Conversation
Owner
|
Hi, thanks a lot! I'll have a look on Tuesday. |
philippgille
approved these changes
Oct 3, 2023
Owner
philippgille
left a comment
There was a problem hiding this comment.
Thank you very much for your contribution!
Two comments, but not blockers.
| t.Helper() | ||
|
|
||
| if err == nil { | ||
| t.Error("expect error, got nil") |
Owner
There was a problem hiding this comment.
Not a blocker, but checking all other *_test.go files in this repo, they use either "Expected an error" or "An error was expected". The exact phrasing doesn't matter, but I'd suggest uppercase and past tense for consistency, e.g.
Suggested change
| t.Error("expect error, got nil") | |
| t.Error("Expected error, got nil") |
Errors are usually lowercase as they can be chained in a log message (e.g. "couldn't x: failed to y: ...", but here it's a log message and not an error that might be chained, where I like the differentiation.
Again, totally not a blocker though.
Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>
Closed
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.
Hello
In some scenarios it is interesting add an object that does nothing (for testing, debug, etc)
for instance, imagine I may use one of few different implementations of
govk.Storeand I decide it based on configuration using some strategy pattern. To test the application without thegovk.StoreI had two options:if store != nil {... }around the code, ornot anymore!
This also perform the validation of key / value like a regular
gokv.Storedoes, to avoid break compatibility.If you want, I can add an option to disable this validation
Enjoy