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

Fix for applyOptionsWithDefault not keeping unmodified options #169

Merged
merged 1 commit into from
Oct 10, 2022

Conversation

sgtsquiggs
Copy link
Contributor

I assume this was just an oversight. I was expecting that any specified options would override defaults, but unspecified options would still use the default options.

IE:

// Given
defaultOptions := &Options{
	expiration: 25 * time.Second,
}

// When
options := applyOptionsWithDefault(defaultOptions, WithCost(7))

// Then
assert.Equal(t, int64(7), options.cost)
assert.Equal(t, 25*time.Second, options.expiration)

@sgtsquiggs
Copy link
Contributor Author

fixes #168

@sgtsquiggs
Copy link
Contributor Author

failures seem unrelated

@eko eko merged commit 585ab24 into eko:master Oct 10, 2022
@eko
Copy link
Owner

eko commented Oct 10, 2022

Yes, I will take a look later. Thank you for this PR!

@sgtsquiggs sgtsquiggs deleted the fix-applyOptionsWithDefault branch October 26, 2022 22:02
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