fix: disable specific staticcheck rules and update lint config (#4396)

fix: disable specific staticcheck rules and update lint config

- Disabled staticcheck rules SA1029, SA1019, S1000, and related checks
in `.golangci.yml` to filter out unwanted linter errors.
- Updated staticcheck checks list for more precise linting control.
- Clarified configuration for easier maintenance and future updates.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hailaz <739476267@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2025-08-29 10:32:30 +08:00
committed by GitHub
parent 71743e6903
commit 94cc233325
47 changed files with 231 additions and 208 deletions

View File

@ -103,7 +103,7 @@ func filterLinesOfStackInfos(infos []*stackInfo) {
func formatStackInfos(infos []*stackInfo) string {
buffer := bytes.NewBuffer(nil)
for i, info := range infos {
buffer.WriteString(fmt.Sprintf("%d. %s\n", i+1, info.Message))
fmt.Fprintf(buffer, "%d. %s\n", i+1, info.Message)
if info.Lines != nil && info.Lines.Len() > 0 {
formatStackLines(buffer, info.Lines)
}
@ -124,10 +124,11 @@ func formatStackLines(buffer *bytes.Buffer, lines *list.List) string {
if i >= 9 {
space = " "
}
buffer.WriteString(fmt.Sprintf(
fmt.Fprintf(
buffer,
" %d).%s%s\n %s\n",
i+1, space, line.Function, line.FileLine,
))
)
}
return buffer.String()
}