Skip to content

Commit 88ee351

Browse files
committed
Remove useless code blocks from address.Final() #72
1 parent 19ec725 commit 88ee351

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

address/lib.go

+1-16
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,9 @@ func Undisclosed(argv0 bool) string {
2929
// - (string): Email address without angle brackets such as "[email protected]"
3030
func Final(argv0 string) string {
3131
if strings.Count(argv0, "@") != 1 { return argv0 }
32-
3332
for strings.HasPrefix(argv0, "<") { argv0 = strings.Trim(argv0, "<") }
3433
for strings.HasSuffix(argv0, ">") { argv0 = strings.Trim(argv0, ">") }
35-
36-
atmark := strings.LastIndex(argv0, "@")
37-
useris := argv0[0:atmark]
38-
hostis := argv0[atmark+1:]
39-
40-
if rfc5322.IsQuotedAddress(argv0) == false {
41-
// Remove all the angle brackets from the local part
42-
useris = strings.ReplaceAll(useris, "<", "")
43-
useris = strings.ReplaceAll(useris, ">", "")
44-
}
45-
46-
// Remove all the angle brackets from the domain part
47-
hostis = strings.ReplaceAll(hostis, "<", "")
48-
hostis = strings.ReplaceAll(hostis, ">", "")
49-
return useris + "@" + hostis
34+
return argv0
5035
}
5136

5237
// IsIncluded returns true if the string includes an email address.

0 commit comments

Comments
 (0)