diff --git a/go/l19/l1.go b/go/l19/l1.go index 3d7d756..a3c84d4 100644 --- a/go/l19/l1.go +++ b/go/l19/l1.go @@ -26,6 +26,15 @@ func handle(w http.ResponseWriter, r *http.Request) { http.Error(w,"no", http.StatusBadRequest) return } + CheckEmail := strings.ContainsAny(data.Email, "@.") + if CheckEmail != true { + http.Error(w, "incorrect email", http.StatusBadRequest) + return + } + if data.Age > 150 { + http.Error(w, "old", http.StatusBadRequest) + return + } defer r.Body.Close() setChan <- data