Skip to content

tonnytg/chkMail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Module Valid Email

Go

This is a simple module for Go to validate a Email regex.

How install?

go get github.com/tonnytg/chkmail

Doc

func ChkReg(n string) bool

Example

Create a simple project and import this module:

package main  
  
import (  
   "fmt"  
 "github.com/tonnytg/gckmail")  
  
func main()  {  
   mail := "11111111111111" // invalid mail
  if m := chkmail.ChkReg(mail); m {  
      fmt.Printf("Email %v, it is valid!", mail)  
   } else {  
      fmt.Println("Email invalid")  
   }  
}

Benchmark

go test -bench=.

goos: darwin
goarch: arm64
pkg: github.com/tonnytg/chkmail
BenchmarkChkReg-16                171973              7017 ns/op
BenchmarkChkRegMultiple-16         58987             20420 ns/op
PASS
ok      github.com/tonnytg/chkmail      4.061s

About

Check Valid Mail Regex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages