init
This commit is contained in:
commit
e87166741a
25
main.go
Normal file
25
main.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user