-
Notifications
You must be signed in to change notification settings - Fork 7
Add GitHub Actions and Codecov usage guide #42
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
Merged
minorcell
merged 7 commits into
1024XEngineer:main
from
pionxe:docs-github-actions-codecov-guide
Mar 24, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7e2038f
Add GitHub Actions and Codecov usage guide
pionxe 6ea11d5
Fix cross-platform UTF-8 console setup for CI
pionxe 6011f83
Add comment for setUTF8Mode function
pionxe b3fffab
Use x/sys/windows for UTF-8 console setup
pionxe fa5fa6a
Add docs navigation links to README
pionxe 45ef532
Rename Codecov guide to hyphen-case
pionxe cf2a470
Align CI guide with workflow and lint guidance
pionxe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| //go:build !windows | ||
|
|
||
| package main | ||
| // setUTF8Mode 在非 Windows 系统上是空操作。 | ||
| // Linux 和 macOS 默认使用 UTF-8 编码,无需额外设置。 | ||
| func setUTF8Mode() {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| //go:build windows | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
|
|
||
| "golang.org/x/sys/windows" | ||
| ) | ||
|
|
||
| const utf8CodePage = 65001 | ||
|
|
||
| func setUTF8Mode() { | ||
| if err := windows.SetConsoleOutputCP(utf8CodePage); err != nil { | ||
| fmt.Fprintf(os.Stderr, "警告: 设置控制台输出编码失败: %v\n", err) | ||
| } | ||
| if err := windows.SetConsoleCP(utf8CodePage); err != nil { | ||
| fmt.Fprintf(os.Stderr, "警告: 设置控制台输入编码失败: %v\n", err) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议:考虑是否需要支持 Linux/macOS 的 UTF-8 设置
非 Windows 系统(Linux/macOS)默认 locale 通常是 UTF-8,但并不绝对。当前非 Windows 平台的
setUTF8Mode()是空函数,这在绝大多数情况下没有问题。但若要更严谨,可以在此文件中添加注释说明为什么非 Windows 系统不需要此操作,例如:
这样有助于后续维护者理解代码意图。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已添加相应注释