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

fix: 修复标准路由结构体参数执行失败的问题 #2931

Closed
wants to merge 1 commit into from

Conversation

hailaz
Copy link
Member

@hailaz hailaz commented Sep 5, 2023

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Patch coverage: 77.21% and no project coverage change.

Comparison is base (74bf1b4) 79.15% compared to head (62e9047) 79.15%.
Report is 7 commits behind head on master.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2931   +/-   ##
=======================================
  Coverage   79.15%   79.15%           
=======================================
  Files         638      639    +1     
  Lines       52570    52607   +37     
=======================================
+ Hits        41611    41642   +31     
- Misses       8892     8903   +11     
+ Partials     2067     2062    -5     
Flag Coverage Δ
go-1.18-386 79.19% <77.21%> (+<0.01%) ⬆️
go-1.18-amd64 79.24% <77.21%> (+0.03%) ⬆️
go-1.19-386 79.12% <77.21%> (+0.02%) ⬆️
go-1.19-amd64 79.13% <77.21%> (+0.03%) ⬆️
go-1.20-386 79.19% <77.21%> (-0.05%) ⬇️
go-1.20-amd64 79.17% <77.21%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
container/gmap/gmap_hash_str_any_map.go 98.20% <ø> (ø)
database/gdb/gdb.go 68.34% <ø> (ø)
database/gdb/gdb_result.go 36.00% <ø> (+3.85%) ⬆️
internal/instance/instance.go 100.00% <ø> (ø)
os/gcache/gcache.go 96.77% <ø> (ø)
os/gtime/gtime.go 86.93% <ø> (ø)
text/gregex/gregex_cache.go 100.00% <ø> (ø)
text/gstr/gstr_slashes.go 100.00% <ø> (ø)
text/gstr/gstr_sub.go 93.47% <ø> (ø)
contrib/drivers/dm/dm.go 69.70% <45.83%> (-0.55%) ⬇️
... and 21 more

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hailaz hailaz requested a review from gqcn September 5, 2023 02:32
@hailaz hailaz added the done This issue is done, which may be release in next version. label Sep 5, 2023
@@ -36,6 +37,13 @@ func (c *cUser) User(ctx context.Context, req *UserReq) (res *UserRes, err error
return
}

type cUserStruct struct{}

func (c *cUserStruct) User(ctx context.Context, req UserReq) (res UserRes, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实规范路由下,输入的Req对象应该是指针。建议之类不支持非指针的Req对象,而是在路由注册的时候增加输入参数的类型校验。

@hailaz hailaz closed this Sep 6, 2023
@hailaz hailaz deleted the fix/2904 branch September 27, 2023 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done This issue is done, which may be release in next version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants