-
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
Added handling for non-zero values excluding false
#35
Conversation
zap/zp_test.go
Outdated
@@ -0,0 +1,187 @@ | |||
package zap |
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.
rename file to zap_test.go
zap/zp_test.go
Outdated
value any | ||
want []any | ||
}{ | ||
// Nil and Zero cases |
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.
comments not needed :) Just name test correctly
zap/zp_test.go
Outdated
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
appendFilledFieldsOnly(&tt.fields, tt.key, tt.value) |
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.
You know key will always be string. Just remove this from here and use static "key" string.
appendFilledFieldsOnly(&tt.fields, tt.key, tt.value) | |
appendFilledFieldsOnly(&tt.fields, "key", tt.value) |
zap/zp_test.go
Outdated
{ | ||
name: "nil key", | ||
fields: []any{}, | ||
key: "nil", | ||
value: "value", | ||
want: []any{"nil", "value"}, | ||
}, |
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.
no need to test keys I believe :) string is string.
No description provided.