However, now that you mention it, I suppose it wouldn't have hurt, and the meaning would have been fairly clear. Oh well - live and learn, at this point, I'm doing my best not to break backwards compatibility if I don't have to.
Thanks for the heads up!
[1] http://golang.org/doc/effective_go.html#composite_literals
[2] https://sites.google.com/site/gopatterns/object-oriented/con...
"Why the tab in column 1? Yacc was new, Lex was brand new. I hadn't tried either, so I figured this would be a good excuse to learn. After getting myself snarled up with my first stab at Lex, I just did something simple with the pattern newline-tab. It worked, it stayed. And then a few weeks later I had a user population of about a dozen, most of them friends, and I didn't want to screw up my embedded base. The rest, sadly, is history."
package main
import (
"log"
"net/smtp"
"github.com/jordan-wright/email"
)
func main() {
e := email.NewEmail()
e.From = "Jordan Wright <[email protected]>"
e.To = []string{"[email protected]"}
e.Bcc = []string{"[email protected]"}
e.Cc = []string{"[email protected]"}
e.Subject = "Awesome Subject"
e.Text = "Text Body is, of course, supported!"
e.HTML = "<h1>Fancy HTML is supported, too!</h1>"
err := e.Send("smtp.gmail.com:587",
smtp.PlainAuth("", "[email protected]", "pw", "smtp.gmail.com"))
if err != nil {
log.Fatal(err)
}
}To be fair, you could write:
e = &email.Email{ [fields and values] }
The only thing NewEmail does is give you a pointer to an Email.