René's URL Explorer Experiment


Title: fix(debug): Delve 在当前文件所在的包目录构建、调试和运行 by xiaoyumuxi · Pull Request #10 · Lithe-IDEA/lithe-plugin-go · GitHub

Open Graph Title: fix(debug): Delve 在当前文件所在的包目录构建、调试和运行 by xiaoyumuxi · Pull Request #10 · Lithe-IDEA/lithe-plugin-go

X Title: fix(debug): Delve 在当前文件所在的包目录构建、调试和运行 by xiaoyumuxi · Pull Request #10 · Lithe-IDEA/lithe-plugin-go

Description: 背景 如果打开的文件夹根目录没有 go.mod,而是并排放着几个模块,例如课程目录下的 cnscc368-1…4,调试其中某个模块的 main.go 会报 Failed to launch: Build error ... go.mod file not found。原因是 Delve 在工作区根目录执行 go build。即使能编译,被调程序也在根目录运行,examples/topo1.txt 这类按包目录写的相对路径打不开。 用 Delve 1.27.2 的 DAP 实测,需要同时满足下面三点: dlvCwd ← 包目录:Delve 先 os.Chdir(dlvCwd) 再执行 go build。 env.PWD ← 包目录:Delve 不更新 PWD;go 只在 PWD 和真实目录一致时用它。路径经过符号链接(macOS 的 /var)时,如果不设 PWD,会报 outside main module,断点报 could not find file。 cwd ← 包目录:调试引擎在 launch 参数缺 cwd 时会填工作区根目录。 改动 io.github.lithe-idea.go-support/plugin.json,Delve 的 launch 配置: arguments:{"mode": "debug", "program": ".", "env": {"GO111MODULE": "auto"}}。program: "." 配合 dlvCwd 构建当前包;GO111MODULE=auto 让没有 go.mod 的目录按 GOPATH 模式构建目录里的全部文件。 targetBindings:{"cwd": "target.directory", "args": "target.arguments", "adapterArguments": {"dlvCwd": "target.directory", "env.PWD": "target.directory"}},去掉了原来的 program 和 env 绑定。 e2e/host/desktop/internal/workbench/official_go_plugin_debug_e2e_test.go:新增 TestOfficialGoPluginDebugsEachProjectOfAWorkspaceWithDelve。工作区根目录没有 go.mod,包含: lab-1、lab-2 两个模块,其中 lab-2 读取包目录下的 examples/greeting.txt,读不到就 panic; lab-2/cmd/tool 子包; 没有 go.mod 的 scratch 目录。 测试依次调试 lab-2/main.go、lab-2/cmd/tool/main.go、scratch/main.go,检查断点命中的文件和行号、程序正常结束,并确认没有留下 __debug_bin*。 e2e/host/lithe-host.json:测试正则加入新测试。 README.md:调试一节说明包目录、多模块工作区和没有 go.mod 的目录。 docs/feature-matrix.md:go-debug-delve 更新能力说明和宿主依赖。 依赖与发版 依赖 Lithe-IDEA/Lithe-core-rust#55,它新增了 targetBindings.adapterArguments 和 cwd ← target.directory。还依赖桌面端固定这个 Core 的 1lck/Lithe-IDEA#1975。 旧宿主不认识 adapterArguments(deny_unknown_fields),会拒绝安装这个版本。合入后不要马上发版,要等包含 #55 的桌面端版本发布。 验证 node scripts/package.mjs:打包通过。 TestOfficialGoPluginBuildsAndServesAModule:在固定 Core 671cdc6 的宿主分支上通过。 调试 e2e 在 671cdc6 上暴露了 cwd 落到工作区根目录的问题(lab-2 读文件 panic),于是 Core #55 增加了 cwd ← target.directory。 合入后补跑(2026-11-15):node scripts/e2e-host.mjs --ref fix/core-pin-56-merge,宿主为 1lck/Lithe-IDEA#1976(Core 9425469,即 #55 + #56 在 Core main 上的提交),插件包来自 main 8595a25。TestOfficialGoPluginDebugsEachProjectOfAWorkspaceWithDelve 和 TestOfficialGoPluginBuildsAndServesAModule 都通过。docs/feature-matrix.md 的“最近验证”和 e2e/host/lithe-host.json 的宿主固定版本,等 #1976 合入后另开 PR 更新。

Open Graph Description: 背景 如果打开的文件夹根目录没有 go.mod,而是并排放着几个模块,例如课程目录下的 cnscc368-1…4,调试其中某个模块的 main.go 会报 Failed to launch: Build error ... go.mod file not found。原因是 Delve 在工作区根目录执行 go build。即使能编译,被调程序也在根目录运行,examples/topo1.t...

X Description: 背景 如果打开的文件夹根目录没有 go.mod,而是并排放着几个模块,例如课程目录下的 cnscc368-1…4,调试其中某个模块的 main.go 会报 Failed to launch: Build error ... go.mod file not found。原因是 Delve 在工作区根目录执行 go build。即使能编译,被调程序也在根目录运行,examples/topo1.t...

Opengraph URL: https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:24cfa329-0caa-a4b0-c6df-9263d72abf00
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB134:15BD99:1B3FFE4:266AC54:6B072AD2
html-safe-noncedced9faaea15d44076ddda6335f76350e315da2a77bf423aed8b01e37f33f9bb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTM0OjE1QkQ5OToxQjNGRkU0OjI2NkFDNTQ6NkIwNzJBRDIiLCJ2aXNpdG9yX2lkIjoiMTI1MTA1MDgyNzUzMjQxMzY1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaced5fd55dcd6cf39d9564ee149ed8552edbba8337e9b50b2e70243b99b0435dd9
hovercard-subject-tagpull_request:5321834644
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
twitter:imagehttps://avatars.githubusercontent.com/u/145102356?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/145102356?s=400&v=4
og:image:alt背景 如果打开的文件夹根目录没有 go.mod,而是并排放着几个模块,例如课程目录下的 cnscc368-1…4,调试其中某个模块的 main.go 会报 Failed to launch: Build error ... go.mod file not found。原因是 Delve 在工作区根目录执行 go build。即使能编译,被调程序也在根目录运行,examples/topo1.t...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned0534ce3ec0f37caea4f39713cbc8a6a509506c09c7ac30e8e3e2e15348bd9c1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/Lithe-IDEA/lithe-plugin-go git https://github.com/Lithe-IDEA/lithe-plugin-go.git
octolytics-dimension-user_id340144206
octolytics-dimension-user_loginLithe-IDEA
octolytics-dimension-repository_id1426387415
octolytics-dimension-repository_nwoLithe-IDEA/lithe-plugin-go
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1426387415
octolytics-dimension-repository_network_root_nwoLithe-IDEA/lithe-plugin-go
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea73ca0a5164c4669446bdffe239b0d7542ad735e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FLithe-IDEA%2Flithe-plugin-go%2Fpull%2F10%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FLithe-IDEA%2Flithe-plugin-go%2Fpull%2F10%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=Lithe-IDEA%2Flithe-plugin-go
Reloadhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
Reloadhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
Reloadhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
Lithe-IDEAhttps://github.com/Lithe-IDEA
lithe-plugin-gohttps://github.com/Lithe-IDEA/lithe-plugin-go
Codehttps://github.com/Lithe-IDEA/lithe-plugin-go
Issues1 (1)https://github.com/Lithe-IDEA/lithe-plugin-go/issues
Pull requests1 (1)https://github.com/Lithe-IDEA/lithe-plugin-go/pulls
Actionshttps://github.com/Lithe-IDEA/lithe-plugin-go/actions
Projectshttps://github.com/Lithe-IDEA/lithe-plugin-go/projects
Security and qualityhttps://github.com/Lithe-IDEA/lithe-plugin-go/security
Insightshttps://github.com/Lithe-IDEA/lithe-plugin-go/insights
Sign up for GitHub https://github.com/signup?return_to=%2FLithe-IDEA%2Flithe-plugin-go%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FLithe-IDEA%2Flithe-plugin-go%2Fissues%2Fnew%2Fchoose
xiaoyumuxihttps://github.com/xiaoyumuxi
mainhttps://github.com/Lithe-IDEA/lithe-plugin-go/tree/main
fix/delve-dlvcwd-package-directoryhttps://github.com/Lithe-IDEA/lithe-plugin-go/tree/fix/delve-dlvcwd-package-directory
Conversation 0 https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10
Commits 1 https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/commits
Checks 1 https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/checks
Files changed https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
Please reload this pagehttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
fix(debug): Delve 在当前文件所在的包目录构建、调试和运行 https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#top
Show all changes 1 commit https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
30f81c2 fix(debug): Delve 在当前文件所在的包目录构建、调试和运行 xiaoyumuxi Nov 15, 2026 https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/commits/30f81c21607dc7d25ba30501c2d994820b45bb66
Clear filters https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
Please reload this pagehttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
Please reload this pagehttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
README.md https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
feature-matrix.md https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-230cb4405678cb67c93fbdcd7658be5c10575acce6ff9051e59d28c27c7f73b0
official_go_plugin_debug_e2e_test.go https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
lithe-host.json https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-c013178d58d8dfd69f434e74897cd81b468b0e418d164ee2635da2652bb100ca
plugin.json https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-dce9d92a8c340c7698d19edcb4c1b2743899db3bd6c27250e173ea599be6f4e8
README.mdhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/Lithe-IDEA/lithe-plugin-go/blob/30f81c21607dc7d25ba30501c2d994820b45bb66/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/{{ revealButtonHref }}
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
docs/feature-matrix.mdhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-230cb4405678cb67c93fbdcd7658be5c10575acce6ff9051e59d28c27c7f73b0
View file https://github.com/Lithe-IDEA/lithe-plugin-go/blob/30f81c21607dc7d25ba30501c2d994820b45bb66/docs/feature-matrix.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/{{ revealButtonHref }}
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-230cb4405678cb67c93fbdcd7658be5c10575acce6ff9051e59d28c27c7f73b0
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-230cb4405678cb67c93fbdcd7658be5c10575acce6ff9051e59d28c27c7f73b0
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-230cb4405678cb67c93fbdcd7658be5c10575acce6ff9051e59d28c27c7f73b0
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-230cb4405678cb67c93fbdcd7658be5c10575acce6ff9051e59d28c27c7f73b0
e2e/host/desktop/internal/workbench/official_go_plugin_debug_e2e_test.gohttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
View file https://github.com/Lithe-IDEA/lithe-plugin-go/blob/30f81c21607dc7d25ba30501c2d994820b45bb66/e2e/host/desktop/internal/workbench/official_go_plugin_debug_e2e_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/{{ revealButtonHref }}
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-3dd4264ba356a80cdb0c42316d2cc04a8ab9849350e986d8a6a7f12f4c0b816f
e2e/host/lithe-host.jsonhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-c013178d58d8dfd69f434e74897cd81b468b0e418d164ee2635da2652bb100ca
View file https://github.com/Lithe-IDEA/lithe-plugin-go/blob/30f81c21607dc7d25ba30501c2d994820b45bb66/e2e/host/lithe-host.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/{{ revealButtonHref }}
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-c013178d58d8dfd69f434e74897cd81b468b0e418d164ee2635da2652bb100ca
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-c013178d58d8dfd69f434e74897cd81b468b0e418d164ee2635da2652bb100ca
io.github.lithe-idea.go-support/plugin.jsonhttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-dce9d92a8c340c7698d19edcb4c1b2743899db3bd6c27250e173ea599be6f4e8
View file https://github.com/Lithe-IDEA/lithe-plugin-go/blob/30f81c21607dc7d25ba30501c2d994820b45bb66/io.github.lithe-idea.go-support/plugin.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/{{ revealButtonHref }}
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-dce9d92a8c340c7698d19edcb4c1b2743899db3bd6c27250e173ea599be6f4e8
https://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files#diff-dce9d92a8c340c7698d19edcb4c1b2743899db3bd6c27250e173ea599be6f4e8
Please reload this pagehttps://github.com/Lithe-IDEA/lithe-plugin-go/pull/10/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.