You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.
@andysnowden I haven't sent multiple with this repo yet...but I have code in production using the old repo and Attach() was resulting in all the appropriate attachments. Is there a way to reproduce this?
I have updated the code to use this active repo though...so if there's gonna be a problem...I'll see it soon.
@andysnowden I don't think the problem in that issue is a bug in the library. It is likely the use of the loop variable in a closure. The loop variable f gets captured in the closures. When the closures are called after the loop completes, they all use the same variable which contains the last loop value. SetCopyFunc takes the given closure and stores it in a file object, so by the time the closure is called later it is using the captured loop variable that contains the last loop value. Here is an example showing how the loop variable returns the last loop value while the copied version of the loop variable is the expected value (you can also copy the loop variable by wrapping the loop code with a closure to avoid having a different variable name): https://play.golang.org/p/b6u5Yuce0_J
Per original issue go-gomail#126 this is still happening. The issue however does not occur when using the AttachReader() variant
The text was updated successfully, but these errors were encountered: