-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# CHANGE LOG | ||
|
||
## V2 | ||
|
||
- use sync.Pool for optimize create Validation. | ||
|
||
```go | ||
// Validation definition | ||
type Validation struct { | ||
// for optimize create instance. refer go-playground/validator | ||
v *Validation | ||
pool *sync.Pool | ||
|
||
// ... | ||
} | ||
|
||
v.pool = &sync.Pool{ | ||
New: func() interface{} { | ||
return &Validation{ | ||
v: v, | ||
} | ||
}, | ||
} | ||
``` | ||
|
||
- all data operate move to DataSource | ||
|
||
```go | ||
type DataFace interface { | ||
BindStruct() error | ||
SafeVal(field string) interface{} | ||
|
||
... | ||
} | ||
|
||
``` |
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
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