Skip to content

Commit 50ec829

Browse files
committed
docs: optimize comment and readme
Change-Id: Id8b950d948873fe8d0e4b2b897296c8cf86c5101
1 parent f333140 commit 50ec829

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

spec_func.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var funcList = map[string]func(p *Expr, expr *string) ExprNode{}
2929

3030
// RegFunc registers function expression.
3131
// NOTE:
32-
// example: len($) to returns the v's length;
32+
// example: len($), regexp("\\d") or regexp("\\d",$);
3333
// If @force=true, allow to cover the existed same @funcName;
3434
// The go number types always are float64;
3535
// The go string types always are string.

validator/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A powerful validator that supports struct tag expression.
88
- Support for accessing arrays, slices, members of the dictionary
99
- Support access to any field in the current structure
1010
- Support access to nested fields, non-exported fields, etc.
11-
- Built-in len, sprintf, regexp functions
11+
- Built-in len, sprintf, regexp, email, phone functions
1212
- Support simple mode, or specify error message mode
1313
- Use offset pointers to directly take values, better performance
1414

validator/func.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"github.com/nyaruka/phonenumbers"
88
)
99

10-
// RegValidateFunc registers simple validate function expression.
10+
// RegValidateFunc registers validate function expression.
1111
// NOTE:
12-
// example: email($) or email();
12+
// example: phone($) or phone($,'CN');
1313
// If @force=true, allow to cover the existed same @funcName;
1414
// The go number types always are float64;
1515
// The go string types always are string.

0 commit comments

Comments
 (0)