I'm having trouble pulling out the domain for emails. I've tried using variations of
u, _ := url.Parse(email)
and other parsing from the standard library, but nothing that seems to parse: user@gmail.com into separate parts.
I've also tried net.SplitHostPort with no luck.
I don't want to get create a function which gets the len and separate to get substring after @ symbol if possible.
Does anyone have any ideas to do this?
Thanks!