This commit is contained in:
Stephen McQuay 2016-04-14 23:17:05 -07:00 committed by Stephen McQuay (smcquay)
commit e87166741a
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D
1 changed files with 25 additions and 0 deletions

25
main.go Normal file
View File

@ -0,0 +1,25 @@
package main
import (
"fmt"
"net/mail"
"os"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "usage: mailchk <email>\n")
os.Exit(1)
}
var err error
for _, email := range os.Args[1:] {
if _, err = mail.ParseAddress(email); err != nil {
fmt.Fprintf(os.Stderr, "problem parsing email %q: %v\n", email, err)
}
}
if err != nil {
os.Exit(1)
}
}