refactor(services): Modernize Go code style in collection and filters services
Apply Go 1.18+ language features and modern style:
internal/services/collection_service.go:
- Use map[string]any instead of map[string]interface{} (Go 1.18+)
- Use range clause with single variable for iteration-only loops
- Replace if-else chains with switch statements for better readability
- Remove explicit type initialization for zero values
internal/services/filters.go:
- Add Err prefix to custom error variable for error naming convention
internal/router/library.go:
- Use cfg.ProcessingIssuesHandler instead of local processingIssuesHandler variable
- Ensures proper dependency injection through router config
These changes follow current Go best practices and improve code readability.
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
// Custom errors for saved filters
|
||||
// ErrFilterNotFound - Custom errors for saved filters
|
||||
var ErrFilterNotFound = errors.New("filter not found or access denied")
|
||||
|
||||
type FiltersService struct {
|
||||
|
||||
Reference in New Issue
Block a user