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

inefficient and unused default merge conditional #160

Closed
bionoren opened this issue Aug 11, 2020 · 2 comments
Closed

inefficient and unused default merge conditional #160

bionoren opened this issue Aug 11, 2020 · 2 comments

Comments

@bionoren
Copy link

bionoren commented Aug 11, 2020

As of this writing, merge.go:274-278 read thus:

v := fmt.Sprintf("%v", src)
if v == "TestIssue106" {
	fmt.Println(mustSet)
	fmt.Println(dst.CanSet())
}

This is the only place the text "TestIssue106" occurs in this codebase (confirmed via find . -type f | xargs grep "TestIssue106"). I suspect this is leftover from a recent testing refactor. The conditional isn't so bad, but the Sprintf overhead adds up for large structs. In addition to the possibility for unexpected prints if someone's struct happens to contain that string...

This code is unused and should be removed.

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/imdario/mergo

bionoren added a commit to modopayments/mergo that referenced this issue Aug 11, 2020
darccio added a commit that referenced this issue Aug 11, 2020
fixed issue #160 by removing unused old test code
@darccio
Copy link
Owner

darccio commented Aug 11, 2020

New version released: https://github.com/imdario/mergo/releases/tag/v0.3.11 Thanks!

@darccio darccio closed this as completed Aug 11, 2020
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

No branches or pull requests

2 participants