Closed whalecold closed 3 years ago
@iawia002
这里他的 name 生成感觉也有点问题,但是找不到生成的地方在哪里,正常来说 name 应该是不包含 pkgPath 的。 下面是我调试的日志:
typ pkg path {} typ kind {slice} typ name {[]github.com/caicloud/clever-fileserver/pkg/files.FileInfo} rootPath {github.com/caicloud/clever-fileserver}..
typ pkg path {github.com/caicloud/clever-fileserver/pkg/files} typ kind {struct} typ name {FileInfo} rootPath {github.com/caicloud/clever-fileserver}..
我检查了下 struct 中的 field 字段 name 中是否包含了 type 拼接出来的后缀,有的话就认定为是一样的定义,然后跳过这次递归。
/cherrypick release-0.3 /lgtm
@iawia002: once the present PR merges, I will cherry-pick it on top of release-0.3 in a new PR and assign it to you.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: iawia002
The full list of commands accepted by this bot can be found here.
The pull request process is described here
@iawia002: new pull request created: #428
What this PR does / why we need it:
修复在生成 API 或者 client 的时候如果某个结构体定义里包含自身字段会无限循环的 bug
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @your-reviewer
Release note: