-
Notifications
You must be signed in to change notification settings - Fork 69
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
add nop store #126
add nop store #126
Conversation
Hi, thanks a lot! I'll have a look on Tuesday. |
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.
Thank you very much for your contribution!
Two comments, but not blockers.
nop/nop_test.go
Outdated
t.Helper() | ||
|
||
if err == nil { | ||
t.Error("expect error, got nil") |
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.
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.
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>
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.
Thanks for the change 💪
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.Store
and I decide it based on configuration using some strategy pattern. To test the application without thegovk.Store
I had two options:if store != nil {... }
around the code, ornot anymore!
This also perform the validation of key / value like a regular
gokv.Store
does, to avoid break compatibility.If you want, I can add an option to disable this validation
Enjoy