mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
chore: upgrade golangci-lint configuration and optimize codebase (#4236)
This PR includes the following changes: - **Upgrade `.golangci.yml`**: Updated the configuration file to align with the latest golangci-lint version, ensuring compatibility and leveraging new features. - **Refactor GitHub Action workflow**: Modified `golangci-lint.yml` in the GitHub Actions workflow to reflect the updated configuration and improve CI performance. - **Codebase optimization**: Refactored code to address issues and warnings raised by the updated golangci-lint rules, including: - Improved function length and complexity. - Enhanced error handling and variable naming conventions. - Fixed minor issues such as unused imports and formatting inconsistencies. These changes aim to maintain code quality, ensure compatibility with the latest tools, and improve overall maintainability.
This commit is contained in:
@ -67,7 +67,7 @@ func (m *Model) WithAll() *Model {
|
||||
|
||||
// doWithScanStruct handles model association operations feature for single struct.
|
||||
func (m *Model) doWithScanStruct(pointer interface{}) error {
|
||||
if len(m.withArray) == 0 && m.withAll == false {
|
||||
if len(m.withArray) == 0 && !m.withAll {
|
||||
return nil
|
||||
}
|
||||
var (
|
||||
@ -190,7 +190,7 @@ func (m *Model) doWithScanStruct(pointer interface{}) error {
|
||||
// doWithScanStructs handles model association operations feature for struct slice.
|
||||
// Also see doWithScanStruct.
|
||||
func (m *Model) doWithScanStructs(pointer interface{}) error {
|
||||
if len(m.withArray) == 0 && m.withAll == false {
|
||||
if len(m.withArray) == 0 && !m.withAll {
|
||||
return nil
|
||||
}
|
||||
if v, ok := pointer.(reflect.Value); ok {
|
||||
|
||||
Reference in New Issue
Block a user