Skip to content

fix(tool): preserve Windows drive-letter GOPATH entries - #1994

Open
dajiaohuang wants to merge 2 commits into
cloudwego:mainfrom
dajiaohuang:fix/windows-gopath-list-separator
Open

fix(tool): preserve Windows drive-letter GOPATH entries#1994
dajiaohuang wants to merge 2 commits into
cloudwego:mainfrom
dajiaohuang:fix/windows-gopath-list-separator

Conversation

@dajiaohuang

Copy link
Copy Markdown

What type of PR is this?

fix

Check the PR title.

  • This PR title matches the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • User documentation is not required because this restores the existing cross-platform behavior of an internal tool helper.

(Optional) Translate the PR title into Chinese.

fix(tool): 保留 Windows GOPATH 条目中的盘符路径

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

en:

GetGOPATH currently splits an explicitly configured GOPATH with a hard-coded colon. On Windows, that truncates a drive-letter path such as C:\Users\example\go to C.

This change uses filepath.SplitList, which follows the host platform's path-list separator, and updates TestGetGOPATH to cover both multiple entries and Windows drive letters. It also makes the existing TestArguments_refGoSrcPath regression pass on Windows.

Validation:

  • go test ./tool/internal_pkg/util ./tool/cmd/kitex/args -count=1
  • go vet ./tool/internal_pkg/util ./tool/cmd/kitex/args
  • go test -run=^$ ./...
  • go build ./...
  • golangci-lint run ./tool/internal_pkg/util ./tool/cmd/kitex/args --new-from-rev=origin/main (0 new issues)

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

Fixes #1993

(optional) The PR that updates user documentation:

Not applicable; no user-facing workflow or option changes.

@dajiaohuang
dajiaohuang requested review from a team as code owners August 24, 2026 18:26
@CLAassistant

CLAassistant commented Aug 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@wdp2020 wdp2020 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@GuangmingLuo

Copy link
Copy Markdown
Member

@dajiaohuang Please sign CLA

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.91%. Comparing base (8bb270e) to head (8805b25).
⚠️ Report is 8 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (8bb270e) and HEAD (8805b25). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (8bb270e) HEAD (8805b25)
unit 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1994       +/-   ##
===========================================
- Coverage   62.95%   51.91%   -11.04%     
===========================================
  Files         394      334       -60     
  Lines       30267    23438     -6829     
===========================================
- Hits        19056    12169     -6887     
- Misses       9924     9936       +12     
- Partials     1287     1333       +46     
Flag Coverage Δ
integration 51.91% <ø> (+0.04%) ⬆️
unit ?

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

tool: GetGOPATH truncates Windows drive-letter paths

4 participants