From 6f3f3463f55a7ad31e90e52ed71a91920c1b3ff0 Mon Sep 17 00:00:00 2001 From: cfculler Date: Fri, 8 Dec 2023 15:28:18 -0800 Subject: [PATCH] Expanded email regex and repinned devops-resources to working version --- examples/ch7/devops-api/go.mod | 2 +- examples/ch7/devops-api/go.sum | 4 ++-- examples/ch7/devops-api/main.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/ch7/devops-api/go.mod b/examples/ch7/devops-api/go.mod index 2428cb0c..bfd91954 100644 --- a/examples/ch7/devops-api/go.mod +++ b/examples/ch7/devops-api/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/gin-gonic/gin v1.8.1 - github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources v0.0.0-20221129190731-63b117bcfecd + github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources v0.0.0-20230921193819-569bb9d9dbdd ) require ( diff --git a/examples/ch7/devops-api/go.sum b/examples/ch7/devops-api/go.sum index 2ba0ff91..92fa7649 100644 --- a/examples/ch7/devops-api/go.sum +++ b/examples/ch7/devops-api/go.sum @@ -32,8 +32,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources v0.0.0-20221129190731-63b117bcfecd h1:qrYCoa6c0YfJI2bXBgqstKhIBIe+5Mm3AMolgiYttOU= -github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources v0.0.0-20221129190731-63b117bcfecd/go.mod h1:Wy8YNDvnY+iVDU2soHwZQFTv0NQ1sBoJQVTe44z4wF0= +github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources v0.0.0-20230921193819-569bb9d9dbdd h1:eiG3C02qmeb9b59I0ZRKItggRZ8Yy1YkIHVnY6+A+hA= +github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources v0.0.0-20230921193819-569bb9d9dbdd/go.mod h1:4/jOK0F/KUFEvemqN4XCD4aVXhAMEZ+VDXR1mPB9CFk= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= diff --git a/examples/ch7/devops-api/main.go b/examples/ch7/devops-api/main.go index 6909889e..3cca7c4d 100644 --- a/examples/ch7/devops-api/main.go +++ b/examples/ch7/devops-api/main.go @@ -6,7 +6,7 @@ import ( "regexp" "github.com/gin-gonic/gin" - "github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources" + devops_resource "github.com/liatrio/devops-bootcamp/examples/ch7/devops-resources" ) // Global maps to access our resources by id key @@ -16,7 +16,7 @@ var operations = make([]*devops_resource.Ops, 0) var developer_operations = make([]*devops_resource.DevOps, 0) func verifyEmail(email string) bool { - result, _ := regexp.MatchString("^([a-zA-Z]|[0-9])+@[a-z]+\\.[a-z]+(\\.[a-z]+)*$", email) + result, _ := regexp.MatchString("^[\\w._%+\\-\\/\\]+@[\\w.\\-]+\\.[a-z]{2,4}$", email) return result }