This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AMI_USERNAME="YOUR_AMI_USERNAME" | |
AMI_PASSWORD="YOUR_AMI_PASSWORD" | |
AMI_HOST="YOUR_AMI_HOST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package email | |
import ( | |
"testing" | |
) | |
func TestIsValidEmail(t *testing.T) { | |
testCases := []struct { | |
name string | |
email string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isValidEmail(Value string) (result bool) { | |
result = false | |
var checkAllowed = regexp.MustCompile(`^[a-zA-z0-9_\-.+]+$`).MatchString | |
i := strings.Index(Value, `@`) | |
if i < 1 { | |
return | |
} | |
if strings.Contains(Value, `..`) || strings.Contains(Value, `@@`) || strings.Contains(Value, `.@`) { | |
return |