Skip to content

Commit 674559b

Browse files
committed
validator: fix EmailRX for v0.7.6
1 parent 0ec64bf commit 674559b

4 files changed

Lines changed: 468 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
env:
4+
GO_VERSION: "1.24"
5+
6+
on:
7+
push:
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: ${{ env.GO_VERSION }}
21+
22+
- name: Download dependencies
23+
run: go mod download
24+
25+
- name: Format code
26+
run: go fmt ./...
27+
28+
- name: Vet code
29+
run: go vet ./...
30+
31+
- name: Run tests
32+
run: go test -race -vet=off ./...
33+
34+
- name: Test coverage
35+
run: |
36+
go test -covermode=count -coverprofile=coverage.out ./...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Toolbox
22

3-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Test](https://github.com/bit8bytes/toolbox/actions/workflows/test.yml/badge.svg)](https://github.com/bit8bytes/toolbox/actions/workflows/test.yml)
44

55
Toolbox is a collection of ultilities to make web easier again. Toolbox doesn't use any external dependencies except of Go's standard library.
66

validator/validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
var (
12-
EmailRX = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+\\.[a-zA-Z]{2,}$")
12+
EmailRX = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,}$")
1313
)
1414

1515
// Validator collects validation errors by field name

0 commit comments

Comments
 (0)