Skip to content
Prev Previous commit
chore: add 'wsl_v5' linter to golangci-lint configuration and refacto…
…r index name extraction in gocqltesting package
  • Loading branch information
eulixir committed Nov 15, 2025
commit b1b0b1f492f803de281ce269bf243ba5364a9b28
13 changes: 1 addition & 12 deletions backend/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ linters:
- tagliatelle
- varnamelen
- wsl
- wsl_v5
- noinlineerr
- gochecknoglobals
- mnd
Expand Down Expand Up @@ -79,15 +80,3 @@ issues:
- linters:
- staticcheck
text: "ST1020:"
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
14 changes: 7 additions & 7 deletions backend/extensions/gocqltesting/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ func copyIndexes(session *cassandra.Session, targetKeyspace, tableName string) e
// Pattern: table_column_idx -> column
func extractColumnFromIndexName(indexName, tableName string) string {
prefix := tableName + "_"
if strings.HasPrefix(indexName, prefix) {
suffix := strings.TrimPrefix(indexName, prefix)
suffix = strings.TrimSuffix(suffix, "_idx")
suffix = strings.TrimSuffix(suffix, "_index")

return suffix
suffix, ok := strings.CutPrefix(indexName, prefix)
if !ok {
return ""
}

return ""
suffix = strings.TrimSuffix(suffix, "_idx")
suffix = strings.TrimSuffix(suffix, "_index")

return suffix
}
2 changes: 1 addition & 1 deletion backend/gateways/http/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func RequestLogger(logger *zap.Logger) gin.HandlerFunc {
}

func Recovery(logger *zap.Logger) gin.HandlerFunc {
return gin.CustomRecovery(func(c *gin.Context, recovered interface{}) {
return gin.CustomRecovery(func(c *gin.Context, recovered any) {
logger.Error("Panic recovered",
zap.Any("error", recovered),
zap.String("path", c.Request.URL.Path),
Expand Down
Loading