Skip to content
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

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Conversation

AbanobNageh
Copy link
Contributor

No description provided.

zap/zp_test.go Outdated
@@ -0,0 +1,187 @@
package zap
Copy link
Collaborator

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
Copy link
Collaborator

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

@piotrowski piotrowski requested a review from nourtalaat January 27, 2025 07:59
zap/zp_test.go Outdated

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
appendFilledFieldsOnly(&tt.fields, tt.key, tt.value)
Copy link
Collaborator

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.

Suggested change
appendFilledFieldsOnly(&tt.fields, tt.key, tt.value)
appendFilledFieldsOnly(&tt.fields, "key", tt.value)

zap/zp_test.go Outdated
Comment on lines 165 to 171
{
name: "nil key",
fields: []any{},
key: "nil",
value: "value",
want: []any{"nil", "value"},
},
Copy link
Collaborator

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.

@AbanobNageh AbanobNageh merged commit 2490e7b into main Jan 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants