Skip to content

Conversation

@Duslia
Copy link
Member

@Duslia Duslia commented Dec 25, 2025

What type of PR is this?

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

修复 cgo 项目文件是原始 go 文件,而 length 为编译后的 cgo 文件导致在获取源码时的 panic 的问题

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional): GoFiles 只包含原始的 .go 源文件,对于 CGO 文件(包含 import "C" ),这些文件在编译前会被 cgo 工具处理;CompiledGoFiles 是实际传递给编译器的 Go 文件,对于 CGO 项目,cgo 工具会生成新的 .go 文件(通常在临时目录中),这些生成的文件包含了 C 代码的 Go 包装器和绑定代码。对于 CGO 项目,需要使用 CompiledGoFiles 以获取正确文件行号的内容。

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@Duslia Duslia force-pushed the fix/cgo_file_parse_fail branch 9 times, most recently from acae580 to d0c6968 Compare December 26, 2025 02:35
@Duslia Duslia force-pushed the fix/cgo_file_parse_fail branch from d0c6968 to a1bd647 Compare December 26, 2025 02:49
continue
var filePath string
if hasCGO {
// Cgo file path is tmp file path, like: /Users/bytedance/Library/Caches/go-build/61/6150fdadd44b9dca151737e261abf95697ba13b799e8dbdd464c0c27b443792a-d.
Copy link
Collaborator

Choose a reason for hiding this comment

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

注释删了吧,透露信息了

@Duslia Duslia merged commit d4c14b3 into cloudwego:main Dec 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants