fix: disable specific staticcheck rules and update lint config#4396
Merged
fix: disable specific staticcheck rules and update lint config#4396
Conversation
* 'master' of github.com:gogf/gf:
refactor: interface{} to any and reflect.Ptr to reflect.Pointer (#4395)
perf(net/gclient): optimize default http.Transport connection pool configuration (#4390)
fix: revert #4388 (#4392)
# Conflicts:
# encoding/gini/gini.go
# encoding/gproperties/gproperties.go
# util/gconv/internal/converter/converter_scan.go
Member
Author
hailaz
requested changes
Aug 28, 2025
…gcl-lint * 'fix/golangcl-lint' of github.com:gogf/gf: Apply gci import order changes # Conflicts: # os/gtime/gtime.go
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes linting issues by disabling specific staticcheck rules and updating the lint configuration. The changes primarily address deprecated API usage and simplify code patterns to align with modern Go practices.
- Replaced deprecated
strings.Title()withcases.Title()from golang.org/x/text - Refactored string formatting to use
fmt.Fprintf()instead offmt.Sprintf()for buffer operations - Updated loop patterns to use simpler for-range syntax and removed unnecessary variables
Reviewed Changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| .golangci.yml | Updated Go version and exit code configuration |
| .github/workflows/golangci-lint.yml | Changed workflow name formatting |
| Multiple Go files | Replaced fmt.Sprintf() + buffer.WriteString() with fmt.Fprintf() for performance |
| text/gstr/gstr_upper_lower.go | Replaced deprecated strings.Title() with cases.Title() |
| Various files | Simplified loop constructs and removed unused variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
|
@houseme 我直接让ai重构了HideStr函数,读起来没那么绕 |
hailaz
approved these changes
Aug 29, 2025
hailaz
approved these changes
Aug 29, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix: disable specific staticcheck rules and update lint config
.golangci.ymlto filter out unwanted linter errors.