This is a simple Go module that allows you to generate random email addresses. It's useful for various testing and development purposes where you need placeholder email addresses.
-
Install the module by running:
go get github.com/tamathecxder/randomail
-
Import the module in your Go code:
import ( "fmt" "github.com/tamathecxder/randomail" )
-
Generate random email addresses using the
GenerateRandomEmails
function:emails := randomail.GenerateRandomEmails(10) for i, email := range emails { fmt.Printf("Random email #%d: %s\n", i+1, email) }
You can customize the list of email domains by modifying the domains variable in the emailgenerator/emailgenerator.go file.
var domains = []string{"example.com", "test.com", "yourdomain.com"}
This module is distributed under the MIT License. You are free to use and modify it for your projects. If you find it helpful or have suggestions, feel free to contribute!
Happy email generation!