Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from gogf:master #56

Open
wants to merge 1,417 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1417 commits
Select commit Hold shift + click to select a range
ac66047
cmd/gf: fix pbentity generate fail in mono-repo (#3547)
oldme-git Apr 29, 2024
3b1d1d3
other: update some issue templates (#3544)
oldme-git Apr 29, 2024
8e075fb
contrib/sdk/httpclient: add custom response handler support, fixe #35…
jswxstw Apr 29, 2024
94c7185
util/gvalid: fix slice enums verification failed (#3566)
xyqweb May 7, 2024
ff28d88
cmd/gf: fix gen enums failed in go version v1.22.1 (#3565)
oldme-git May 7, 2024
74338c4
ci: fix code coverage not sync to CodeCov (#3570)
oldme-git May 10, 2024
0765741
os/gtime: fix #3558 time zone issues (#3561)
wln32 May 10, 2024
cf37731
version: v2.7.1 (#3573)
gqcn May 14, 2024
d5561aa
cmd/gf: add gf init app/mono-app -a (#3550)
oldme-git May 15, 2024
a9a0785
util/gconv: refactor code unit testing (#3591)
oldme-git May 20, 2024
737da95
util/gconv: remove unnecessary logic for function doScanList (#3588)
oldme-git May 20, 2024
1455440
os/gcfg: fix gcfg adaptfile dogetfilepath (#3587)
ynwcel May 20, 2024
15b6046
driver/pgsql: optimize regex for version matching (#3583)
yincongcyincong May 21, 2024
1b23bf4
container/gmap&gset: fix deadlock when removing values during iterati…
LonelySally May 21, 2024
21c8367
os/gtime: fixed gtime ci fail (#3596)
hailaz May 22, 2024
1e8f428
contrib/registry/zookeeper: fix invalid searching prefix (#3598)
cruelchen May 22, 2024
2e47166
os/gcfg: fix file searching issue always returning the configuration …
gqcn May 22, 2024
23df83c
database/gdb: fix deadlock when orm operations perform in cache funct…
gqcn May 22, 2024
17385ee
database/gdb: fix confusing error message in Insert/Update operations…
wln32 May 22, 2024
b675d01
database/gdb: add `unscoped` tag support for orm struct (#3464)
fainc May 22, 2024
8f4d5f7
cmd/gf: refactor gf gen service with AST (#3488)
oldme-git May 27, 2024
9e9e42b
cmd/gf: test gen ctrl comments (#3575)
zcyc May 27, 2024
457f7ab
contrib/drivers: add `README.zh_CN.MD` (#3604)
hailaz May 27, 2024
6b84a37
.github/workflows: fix warning info from node16 on timezone setting (…
hailaz May 30, 2024
f8175e7
drivers/mssql: change driver from `github.com/denisenkom/go-mssqldb` …
oldme-git May 30, 2024
57583a9
.github/workflows: remove code coverage report for folder `example` (…
hailaz May 30, 2024
bd8d046
cmd/gf: add `DaMeng` database driver support (#3606)
Insua May 30, 2024
e3a00d7
cmd/gf: fix missing configuration file support for cli command `pack/…
hailaz Jun 4, 2024
59a775a
util/gvalid: add `171` number support for virtual phone number valida…
swift-fs Jun 4, 2024
4d916ae
os/gres: fix #3611 add custom prefix `/` support for resource packing…
hailaz Jun 4, 2024
ee211db
cmd/gf: improve gf gen ctrl using ast (#3616)
oldme-git Jun 4, 2024
753965b
example: password encrypt-decrypt for database using custom implement…
hailaz Jun 4, 2024
d5825ab
drivers/pgsql:pgsql returning id should use quotation marks,when prim…
Insua Jun 12, 2024
dea0ffc
cmd/gf: add command `gf doc` (#3634)
hailaz Jun 12, 2024
01408f1
cmd/gf: delete binary file when gf run end process (#3628)
oldme-git Jun 12, 2024
2ccbb02
fix: #3613 ignore automatic handling for creating/updating time if it…
jswxstw Jun 12, 2024
88f188d
cmd/gf: use automatic generating package names for go files of dao/do…
Insua Jun 13, 2024
fba878f
net/ghttp: update error message for duplicated routes registering (#3…
hailaz Jun 13, 2024
ffbe9a7
container/gtree: refactor code with gods package (#3595)
oldme-git Jun 13, 2024
74d0945
gerror: fix #3633 `Is` performs the same as errors.Is from go stdlib …
gqcn Jun 13, 2024
4abb32e
contrib/drivers/pgsql: support slice type to insert into array for pg…
oldme-git Jun 18, 2024
7d464d4
net/ghttp: fix args issue for `forkRestartProcess` in graceful restar…
hailaz Jun 24, 2024
dba6c08
net/ghttp: fix Content-Type for `jsonp` response from `application/js…
swift-fs Jun 24, 2024
e8a2629
net/goai: fix: #3660, support multiple file upload parameters for Ope…
hailaz Jun 25, 2024
f8272bc
database/gdb: remove duplicated SQL records in tracing events (#3659)
houseme Jun 25, 2024
8824b8b
os/gcron: add graceful shutdown support (#3625)
vector233 Jun 25, 2024
b11caba
version v2.7.2 (#3663)
gqcn Jun 26, 2024
31a6ae2
fix(cmd/gf): remove dm driver for command `gen dao` as it causes buil…
hailaz Jun 27, 2024
c3cfc01
refactor(container/gring): mark deprecated, package `container/gring`…
gqcn Jun 27, 2024
54423b6
refractor(container/gtree): refactor code with gods package for avltr…
oldme-git Jul 1, 2024
2565bb3
refractor(container/gtree): improve function order of `btree` (#3656)
oldme-git Jul 2, 2024
3e54839
refractor(container/gtree): refactor code with `gods` package for `rb…
oldme-git Jul 2, 2024
559ae0e
chore(.github/template): update document for github pull requests (#3…
hailaz Jul 2, 2024
ba322ba
fix(cmd/gf): fix command `gf up` with `-u` option upgrading packages …
hailaz Jul 17, 2024
4fdafa4
feat(cmd/gf): project templates update for command `gf init` (#3704)
gqcn Jul 24, 2024
144ad5f
ci: add Scorecard workflow (#3702)
fengshunli Jul 24, 2024
cd2d51e
build: bump google.golang.org/protobuf to v1.33.0 (#3697)
fengshunli Jul 24, 2024
9143b26
fix(contrib/nosql/redis): missing err nil check in function `ScriptEx…
JimDevil Jul 29, 2024
dc8bb80
fix(contrib/registry/file/v2): fix the panic caused by channel closin…
zishang520 Aug 14, 2024
a6c361d
fix(os/gtime): fix gtime.Value() when time only, add `time only` exam…
niluan304 Aug 14, 2024
6e5ce98
fix(database/gdb): fix #3649 when constructing query param, `gdb.Row`…
cyjaysong Aug 14, 2024
26d2a98
refactor(nacos-registry): use official nacos sdk instead of the third…
lingcoder Sep 9, 2024
467a5c1
fix(contrib/drivers/pgsql): #3671 fix invalid pgsql insert json type …
Ghw2066 Sep 9, 2024
448df14
fix(util/gconv): #3731 map type name mismatch in switch case statemen…
wlynxg Sep 9, 2024
803cb5a
fix(contrib/drivers/pgsql): fix insert error when data struct field h…
oldme-git Sep 9, 2024
1b4ebc0
perf(util/gconv): add cache logic to enhance performance (#3673)
wln32 Sep 9, 2024
baea1c7
feat: version v2.7.3 (#3763)
gqcn Sep 9, 2024
bb9a3b8
feat(database/gdb): add `time` field type for value converting for/fr…
cyjaysong Sep 10, 2024
6b3fb60
fix(net/goai): fix openapi miss `required` tag of `BizRequest` when s…
niluan304 Sep 10, 2024
9b318bb
perf(database/gdb): performance improvement for struct scanning when …
wln32 Sep 12, 2024
3d63ebf
fix(net/ghttp): skip common response body in common response handler …
wwwfeng Sep 12, 2024
0e471ea
fix(util/gconv): #3764 fix bool converting issue (#3765)
wln32 Sep 12, 2024
e466938
fix(encoding/gxml): XML special character encoding error (#3740)
oldme-git Sep 13, 2024
4ee5bf5
fix(database/gdb): #3754 FieldsEx feature conflicts with soft time fe…
gqcn Sep 13, 2024
6a99931
fix(database/gdb): #3755 error parsing database link without port num…
gqcn Sep 13, 2024
e186eab
fix(debug/gdebug): incorrect package name handling in function Caller…
gqcn Sep 13, 2024
d8b06d0
fix(os/gcache): a little memory leak for removed timestamp key (#3779)
gqcn Sep 14, 2024
fd33dcb
ci: add go version 1.23 support (#3733)
houseme Sep 19, 2024
c4327f6
fix(net/ghttp): server shutdown not graceful using admin api `/debug/…
gqcn Sep 19, 2024
777c2e7
ci: fix mssql docker service failed in ci (#3792)
gqcn Sep 23, 2024
d8e3e9d
fix(utils/utils_str): recognize '+' as a valid numeric sign (#3778)
wwwfeng Sep 23, 2024
8a1c97f
fix(util/gconv): cached field indexes append issue caused incorrect f…
wln32 Sep 23, 2024
e15b543
fix(util/gvalid): retrive empty slice parameter in custom validation …
gqcn Sep 23, 2024
9af8393
fix(net/goai): change default value of RequestBody.Required from true…
gqcn Sep 24, 2024
c13004e
fix(database/gdb): support OrderRandom feature in different databases…
oldme-git Sep 24, 2024
a1ce97e
feat(contrib/registry/etcd/): add `DialTimeout` and `AutoSyncInterval…
fengshunli Sep 24, 2024
76783fd
fix(net/gclient): panic when containing `@file:` parameter value in j…
oldme-git Sep 25, 2024
ab2c3b0
fix(cmd/gf): table and field names converted to its lower case before…
gqcn Sep 25, 2024
3f2b1cb
feat(database/gdb): add year field type support for ORM operations (#…
gqcn Sep 25, 2024
5aa321d
fix(util/gconv): unstable converting when there is an external attrib…
wln32 Sep 25, 2024
a716c6b
feat: new version v2.7.4 (#3809)
gqcn Sep 25, 2024
79451e4
fix(net/ghttp&gclient,contrib/rpc/grpcx): remove request and response…
gqcn Sep 26, 2024
8708dc7
test(drivers/mysql): loose unit testing for transaction (#3819)
oldme-git Sep 28, 2024
f45f648
fix(cmd/gf): creating logic.go empty folder when there is no correct …
oldme-git Sep 28, 2024
66ee52c
fix(database/gdb): invalid order by statement generated when multiple…
LanceAdd Sep 28, 2024
ea09457
fix(os/gcmd): argument index calculating error in multilevel command …
oldme-git Sep 28, 2024
1c97b7a
fix(os/gcache): memory leak for LRU when adding operations more faste…
gqcn Sep 28, 2024
cf74223
refactor(net/gudp): improve implements (#3491)
gqcn Sep 28, 2024
9589384
refactor(encoding/gjson): change data parameter from type any to []by…
gqcn Sep 28, 2024
55b9215
refactor(net/ghttp): enhance `ghttp.StartPProfServer` (#3555)
gqcn Sep 28, 2024
ab3fbdd
build(go.mod): upgrade minimum required go version from 1.18 to 1.20 …
houseme Sep 28, 2024
3abb947
ci: fix mssql docker service starting failed (#3824)
gqcn Sep 28, 2024
8e7f118
fix(contrib/drivers/mssql): fix mssql paging sql generate statement e…
freesme Sep 29, 2024
ee5284a
chore(contrib/registry/polaris): upgrade dependent polaris library ve…
houseme Sep 29, 2024
0ca2ed5
chore(contrib/config/polaris): upgrade dependent polaris library vers…
houseme Sep 29, 2024
3f1439a
build(deps): bump google.golang.org/grpc from 1.51.0 to 1.56.3 in /co…
dependabot[bot] Sep 29, 2024
499f755
build(deps): bump google.golang.org/grpc from 1.51.0 to 1.56.3 in /co…
dependabot[bot] Sep 29, 2024
38622f9
refactor(contrib/trace/jaeger): remove trace jaeger, please use the O…
houseme Sep 29, 2024
459c8ce
feat(os/gfsnotify): add recursive watching for created subfolders and…
gqcn Sep 30, 2024
d4fa2c8
feat(contrib/rpc/grpcx): use grpc.NewClient instead of grpc.Dial (#3684)
oldme-git Sep 30, 2024
183395f
fix(cmd/gf): gen service error when there's version number at the end…
oldme-git Oct 5, 2024
2301de6
fix(util/gutil): invalid empty parameter value check for function `Ge…
gqcn Oct 8, 2024
7cbc9e8
test(os/gcache): fix unit testing occasionally failed due to too shor…
gqcn Oct 8, 2024
91884e7
fix(database/gdb): remove support of Array/Value/Count operations for…
gqcn Oct 8, 2024
a72a9ff
fix(container/gtree): deadlock in Map/MapStrAny functions, comments u…
gqcn Oct 8, 2024
7a68898
feat(encoding/ghtml): add parameter validation for function `SpecialC…
gqcn Oct 8, 2024
ae3ae8b
test(cmd/gf): add unit testing case generating dao/do/entity files fo…
gqcn Oct 8, 2024
4d29939
fix(net/goai): cannot customize OpenAPIv3 type for request parameters…
gqcn Oct 9, 2024
e3e5c89
fix(os/gcmd): cannot retrieve all args if no subcommand defined for a…
gqcn Oct 10, 2024
4b5f637
feat(trace): add trace for Custom trace client and provider (#3847)
houseme Oct 14, 2024
5288b70
fix(util/gconv): one parameter to same tag in multiple struct attribu…
helloteemo Oct 14, 2024
c18339b
feat(contrib/drivers/pgsql): add InsertIgnore support (#3855)
wwwfeng Oct 15, 2024
b1d875a
fix(util/gconv): incorrect fuzzy converting logic (#3874)
wln32 Oct 21, 2024
7dd38a1
feat(database/gdb): add `Raw` support for `Fields` function of `gdb.M…
gqcn Oct 21, 2024
e179e1d
fix(database/gdb): unix socket connection support for mysql (#3872)
gqcn Oct 21, 2024
555bb3f
feat(net/goai): enhance openapi doc with responses and examples (#3859)
UncleChair Oct 21, 2024
656668f
feat: new version v2.8.0-beta (#3878)
gqcn Oct 24, 2024
e4c4fb5
feat(database/gdb): add Exist support for checking records existance …
cyjaysong Oct 24, 2024
d1872f1
fix(util/gconv): assigned the same value to struct field and its same…
wln32 Nov 6, 2024
01cd010
fix(net/gclient): Client Clone with allocated header/cookie (#3902)
CharLemAznable Nov 6, 2024
e7cc2c3
chore: update the contributors in README.MD (#3907)
oldme-git Nov 6, 2024
f4db846
fix(contrib/drivers/pgsql): connection fails when postgres database p…
wlynxg Nov 11, 2024
5ba165a
fix(cmd/gf): go back current working directory after gf gen pb (#3895)
oldme-git Nov 11, 2024
76948d9
test(drivers/mysql): use asserts function to replace if statement (#3…
oldme-git Nov 11, 2024
9cc1cf1
fix(cmd/gf): remove dir after process done if given build file parame…
gqcn Nov 11, 2024
1b7b536
fix(cmd/gf): protoc file comments contain backticks and double quotes…
oldme-git Nov 11, 2024
6c6fd79
feat(database/gdb): remove unnecessary blank character requirement in…
gqcn Nov 11, 2024
bd2e840
chore: update README.MD (#3911)
oldme-git Nov 12, 2024
a63af5d
build: upgrade fsnotify from v1.7.0 to v1.8.0 to solve occasional ci …
gqcn Nov 12, 2024
070efec
style(gtest/test): improve code (#3891)
oldme-git Nov 12, 2024
475e8bb
chore: README.md updates (#3912)
gqcn Nov 12, 2024
fff2f8a
build: downgrade fsnotify from v1.8.0 to v1.7.0 to solve data race er…
gqcn Nov 13, 2024
8c6db24
chore: readme updates (#3919)
gqcn Nov 13, 2024
6baf433
fix(database/gdb): recognize field type `tinyint(1)` to golang type `…
gqcn Nov 13, 2024
ffa6081
fix(util/gconv): fix missing minus in string to int64 conversion (#3920)
UncleChair Nov 13, 2024
955a76c
feat: new version v2.8.0 (#3924)
gqcn Nov 14, 2024
3d4904e
feat(net/ghttp): remove `Req/Res` suffix limitation for input/output …
gqcn Nov 14, 2024
138dea0
feat(cmd/gf): change document source from repo `gf` to `gf-site` (#3926)
hailaz Nov 15, 2024
bcfcda7
chore(errors/gerror): add examples (#3927)
gqcn Nov 16, 2024
ec6c537
feat(cmd/gf): project template updates for command `gf init` (#3928)
gqcn Nov 17, 2024
910703e
chore(database/gdb): comment update for function `Model.Order` (#3933)
wingfeng Nov 18, 2024
0d1aed0
fix(os/gcache): function `Remove` returns value not `*gvar.Var` as pr…
y1jiong Nov 19, 2024
3090fe7
fix(database/gdb): recognize `tinyint(1)/int(1)` as bool (#3943)
gqcn Nov 20, 2024
9085188
fix(registry/zookeeper): watch service name path error with extra suf…
cruelchen Nov 20, 2024
9c8b21a
fix(cmd/gf): incorrect make command in project template (#3946)
gqcn Nov 20, 2024
e9ce1bd
fix(database/gdb): incompatitable statement like `Order("id", "dasc")…
gqcn Nov 21, 2024
3797d0e
feat: new version v2.8.1 (#3950)
gqcn Nov 21, 2024
15f9497
feat(net/goai): add enhanced response status interface (#3896)
UncleChair Nov 23, 2024
ee3eb8d
fix(net/goai): embedded struct with tags also expand as properties of…
wlynxg Nov 23, 2024
eb80249
feat(net/goai): add min, max, length, min-length, max-length and betw…
ninjashixuan Nov 23, 2024
e56371e
fix(cmd/gf): incorrect environment variables printing before cli does…
ppanphper Nov 23, 2024
455830b
test(database/gdb): add more unit testing cases for `Raw` feature (#3…
gqcn Nov 23, 2024
81aed06
feat: README updates (#3974)
gqcn Nov 27, 2024
5521d76
feat(cmd/gf): add `typeMapping` and `fieldMapping` feature support fo…
zishang520 Nov 27, 2024
16d73b5
fix(utils/gvalid): missing pkg path for enums pointer (#3983)
0x7a7a Nov 29, 2024
e572ed0
fix(net/ghttp): get origin through referer (#3990)
y1jiong Dec 1, 2024
9923975
feat(net/gipv4): add enhanced the conversion between uint32 and strin…
oldme-git Dec 1, 2024
c1850d4
feat(net/goai): support OpenAPIv3.1 in description field for schema o…
wlynxg Dec 1, 2024
ec6e091
chore: fix some function names in comment (#3967)
longxiangqiao Dec 1, 2024
5aa7504
fix(util/gpage): code scanning alert no. 9: Potentially unsafe quotin…
houseme Dec 1, 2024
42eae41
fix(util/gutil): code scanning alert no. 17: Potentially unsafe quoti…
houseme Dec 1, 2024
2c916f8
fix(database/gdb): issue where the `Count/Value/Array` query logic wa…
gqcn Dec 1, 2024
2d0cd7b
refactor(cmd/gf): change default src value to `api`, path to `interna…
gqcn Dec 2, 2024
532e665
fix(database/gdb): move `Raw` parameter from args to sql statement be…
gqcn Dec 3, 2024
e2cafa3
fix(cmd/gf): custom tags repeatedly added using command `gf gen pb` w…
wangle201210 Dec 5, 2024
7cd672d
feat(cmd/gf): add interface functions generating for embedded struct …
joy999 Dec 5, 2024
77cb7fb
test(drivers/mssql): add unit testing cases of transaction (#3818)
oldme-git Dec 5, 2024
c0f2ef7
feat(gctx): rename and remove gctx functions to prevent ambiguity (#3…
mingzaily Dec 5, 2024
5fa3341
chore: add example for openapi/swagger authentication (#4004)
wangle201210 Dec 5, 2024
4ad061f
feat(contrib/drivers/pgsql): add array type `varchar[]` and `text[]` …
ninjashixuan Dec 5, 2024
c9b0237
feat: version v2.8.2 (#4009)
gqcn Dec 5, 2024
ba96894
fix(database/gdb): orm tag from embedded struct is missing in `with` …
gqcn Dec 5, 2024
b8142bf
feat(os/gsession): add `RegenerateId/MustRegenerateId` support (#4012)
gqcn Dec 6, 2024
2066aa4
feat(database/gdb): add transaction propagation&isolation level&reado…
gqcn Dec 7, 2024
b0b84a3
ci(gci/import): improve golangci.yml and add gci linter (#4010)
houseme Dec 7, 2024
e18331a
docs(cmd/gen): improve comments for command `gen dao` (#4007)
houseme Dec 7, 2024
3cffa4d
fix(database/gdb): CRUD typos (#4017)
huty1998 Dec 9, 2024
5e47590
feat(database/gdb): add `WhereExists/WhereNotExists` (#4015)
gqcn Dec 9, 2024
80e73da
feat(errors/gerror): add `As` support (#4002)
gqcn Dec 9, 2024
bae78fb
feat(net/ghttp): add middleware `MiddlewareGzip` for compressing resp…
gqcn Dec 9, 2024
13bc192
feat(database/gdb): add sharding feature for schema and table (#4014)
gqcn Dec 9, 2024
2e788be
feat(contrib/registry/consul): add consul registry support (#4016)
gqcn Dec 9, 2024
38bffc7
fix(net/ghttp): occasional ci failed by unit testing cases using `gct…
gqcn Dec 10, 2024
69969b1
fix(contrib/registry/etcd): remove default configuration of `AutoSync…
gqcn Dec 10, 2024
b7c74c9
fix(contrib/drivers/pgsql): add unix socket connection support (#4028)
gqcn Dec 11, 2024
00e2f6b
chore: improve golangci-lint.yml, upgrade dependencies, and optimize …
houseme Dec 11, 2024
d748fb6
fix(contrib/registry/consul): update dependence of gf to v2.8.2 with …
gqcn Dec 11, 2024
5c45d35
fix(ci/golangci): fix golangcl-lint git push (#4032)
houseme Dec 11, 2024
5af342a
fix(net/ghttp): json omitempty takes no effect in `BuildParams`, whic…
gqcn Dec 13, 2024
ced4b57
fix(contrib/drivers/pgsql): incompatible placeholder replacement with…
gqcn Dec 13, 2024
e3e82c7
feat(contrib/config/nacos): add OnChange callbacks configuration supp…
LanceAdd Dec 13, 2024
ac53170
feat(contrib/registry/etcd): add retry machenism when keepalive lease…
gqcn Dec 13, 2024
a09454a
feat(contrib/drivers/mssql): enable unit testing (#4043)
gqcn Dec 16, 2024
5104f01
chore: update FUNDING.yml (#4049)
gqcn Dec 17, 2024
0c2d5ca
feat: new version v2.8.3 (#4048)
gqcn Dec 17, 2024
f79aef6
fix(database/gdb): fix context canceled error in transaction due to u…
gqcn Dec 17, 2024
e7fdf82
test(net/gipv4): add unit tests (#4052)
oldme-git Dec 17, 2024
67a9db9
perf(contrib/drivers/pgsql): improve conversion performace for slice …
ninjashixuan Dec 17, 2024
233295b
fix(os/gview): search file faild from resource manager of package gre…
ynwcel Dec 18, 2024
a5c8b96
feat(util/gconv): add basic types conversion support for function Sca…
gqcn Dec 18, 2024
92eab81
fix(database/gdb): add compatibility for old configiration with both …
gqcn Dec 18, 2024
2c1fcec
Merge branch 'feat/v2.9.0' of github.com:gogf/gf into feat/v2.9.0
gqcn Dec 18, 2024
817ac36
ci: use latest go version for unit testing cases of contribution comp…
gqcn Dec 19, 2024
4c2a78b
fix(database/gdb): regular expression pattern for link configuration …
robotism Dec 19, 2024
594979c
fix(net/ghttp): nil pointer panic error when server logger set nil (#…
gqcn Dec 19, 2024
3a19ee9
fix: securiry update CVE-2024-45338 for package `golang.org/x/net` (#…
y1jiong Dec 25, 2024
96e833d
feat(gf/gen/pbentity): add a `TablesEx` configuration to exclude the …
wwwfeng Dec 26, 2024
e6bee78
Apply gci import order changes
github-actions[bot] Dec 26, 2024
89e5285
feat(net/ghttp): move plugin remove logic to Shutdown() && call Shutd…
wlynxg Dec 26, 2024
6ea1526
fix(ci/golangci): fix golangcl-lint git push and apply format code on…
houseme Dec 26, 2024
9ce2409
fix(util/gpage): `html.EscapeString` for pagination HTML generation …
houseme Dec 26, 2024
80f57d1
fix(database/gdb): `gdb.Counter` not work in `OnDuplicate` (#4073)
cyjaysong Dec 26, 2024
f66e097
feat(contrib/metric/otelmetric): add metrics option `WithExemplarFilt…
qinyuguang Dec 26, 2024
fc9093a
feat(cmd/gf): add `ShardingPattern` option for command `gf gen dao` t…
gqcn Dec 26, 2024
3f24b4d
feat(os/gcmd): add default value display for an argument (#4083)
wlynxg Jan 13, 2025
e0f7348
fix(net/ghttp): `MiddlewareHandlerResponse` writes additional informa…
wlynxg Jan 14, 2025
99f0fb1
fix(net/ghttp): BufferWriter.Flush writes additional information afte…
wlynxg Jan 22, 2025
6bd15b0
merge master
gqcn Jan 22, 2025
1f88452
fix(contrib/config/polaris): it only supports json format for configu…
stardemo Jan 22, 2025
f9c7eae
fix(net/ghttp): remove unused code snippet (#4131)
ansionfor Jan 22, 2025
e127682
feat(cmd/gf): beautify progress bar of cli binary downloading for com…
wangle201210 Jan 22, 2025
20b1987
feat(test/gtest): add map type support for `AssertNI/AssertIN` (#4135)
ansionfor Jan 23, 2025
0eb229a
feat(os/glog): add default time format `2006-01-02T15:04:05.000Z07:00…
gqcn Feb 11, 2025
a3b3c65
feat(database/gdb): enable transaction propagation when using `tx.Get…
cyjaysong Feb 11, 2025
7d3b055
fix(net/ghttp): `MakeBodyRepeatableRead` takes not effective when cal…
cyjaysong Feb 11, 2025
1ef1c44
test(os/gproc): add unit test for os/gproc (#4140)
ansionfor Feb 14, 2025
42d8845
feat(cmd/gf): add `gopackage` option for command `gf gen pbentity` to…
lazyjean Feb 14, 2025
01593ad
fix(ci): golangci-lint failed after upgrading go version to 1.24 (#4158)
gqcn Feb 14, 2025
2fa0355
chore(util/gvalid): using `64` instead of `10` bitsize parameter for …
ansionfor Feb 20, 2025
63cb328
fix(net/ghttp): update response message handling in `MiddlewareHandle…
hailaz Feb 27, 2025
bda42d1
feat(cmd/gf): add controller comment support for command `gf gen ctrl…
ywanbing Feb 27, 2025
2d3ab4f
feat: add submodule `examples` (#4137)
gqcn Feb 27, 2025
ac653d3
Merge branch 'master' into feat/v2.9.0
gqcn Feb 27, 2025
4a65e7a
feat: v2.9.0 (#4057)
gqcn Feb 27, 2025
f4074cd
fix(net/gclient): remove default discovery for gclient when Discovery…
gqcn Mar 3, 2025
dfe088f
refactor(util/gconv): add `Converter` feature for more flexable and e…
gqcn Mar 6, 2025
a8a055f
fix(util/gvalid): lots of memory consumed when `required` validation …
wln32 Mar 7, 2025
bcda48b
fix(net/ghttp):check parameter existence to determine using default o…
river291 Mar 8, 2025
f8331ba
feat(net/ghttp): add `Request.GetMetaTag` to retrieve specific meta t…
PandaPy Mar 9, 2025
029f324
feat: version v2.9.0-beta (#4189)
gqcn Mar 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(util/gvalid): lots of memory consumed when required validation …
…on big binary field (gogf#4097)
  • Loading branch information
wln32 authored Mar 7, 2025
commit a8a055f122d618548d40e0c59a6802a489783f14
52 changes: 33 additions & 19 deletions util/gvalid/gvalid_validator_check_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,26 +287,40 @@ func (v *Validator) doCheckValueRecursively(ctx context.Context, in doCheckValue
}

case reflect.Slice, reflect.Array:
var array []interface{}
if gjson.Valid(in.Value) {
array = gconv.Interfaces(gconv.Bytes(in.Value))
} else {
array = gconv.Interfaces(in.Value)
}
if len(array) == 0 {
return
loop := false
switch in.Type.Elem().Kind() {
// []struct []map
case reflect.Struct, reflect.Map:
loop = true
case reflect.Ptr:
loop = true
}
for _, item := range array {
v.doCheckValueRecursively(ctx, doCheckValueRecursivelyInput{
Value: item,
Type: in.Type.Elem(),
Kind: in.Type.Elem().Kind(),
ErrorMaps: in.ErrorMaps,
ResultSequenceRules: in.ResultSequenceRules,
})
// Bail feature.
if v.bail && len(in.ErrorMaps) > 0 {
break
// When it is a base type array,
// there is no need for recursive loop validation,
// otherwise it will cause memory leakage
// https://github.com/gogf/gf/issues/4092
if loop {
var array []interface{}
if gjson.Valid(in.Value) {
array = gconv.Interfaces(gconv.Bytes(in.Value))
} else {
array = gconv.Interfaces(in.Value)
}
if len(array) == 0 {
return
}
for _, item := range array {
v.doCheckValueRecursively(ctx, doCheckValueRecursivelyInput{
Value: item,
Type: in.Type.Elem(),
Kind: in.Type.Elem().Kind(),
ErrorMaps: in.ErrorMaps,
ResultSequenceRules: in.ResultSequenceRules,
})
// Bail feature.
if v.bail && len(in.ErrorMaps) > 0 {
break
}
}
}
}
Expand Down
35 changes: 35 additions & 0 deletions util/gvalid/gvalid_z_unit_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package gvalid_test
import (
"context"
"fmt"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -114,3 +115,37 @@ func Test_Issue3636(t *testing.T) {
)
})
}

// https://github.com/gogf/gf/issues/4092
func Test_Issue4092(t *testing.T) {
type Model struct {
Raw []byte `v:"required"`
Test []byte `v:"foreach|in:1,2,3"`
}
gtest.C(t, func(t *gtest.T) {
const kb = 1024
const mb = 1024 * kb
raw := make([]byte, 50*mb)
in := &Model{
Raw: raw,
Test: []byte{40, 5, 6},
}
err := g.Validator().
Data(in).
Run(context.Background())
t.Assert(err, "The Test value `6` is not in acceptable range: 1,2,3")
allocMb := getMemAlloc()
t.AssertLE(allocMb, 110)
})
}

func getMemAlloc() uint64 {
byteToMb := func(b uint64) uint64 {
return b / 1024 / 1024
}
var m runtime.MemStats
runtime.ReadMemStats(&m)
// For info on each, see: https://golang.org/pkg/runtime/#MemStats
alloc := byteToMb(m.Alloc)
return alloc
}