Browse Source

Remove unnecessary fmt.Sprintf() calls (gosimple)

This fixes:
pkg/services/sqlstore/migrator/migrations.go:116:18: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
pkg/services/sqlstore/migrator/types.go:49:16: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
Karsten Weiss 7 years ago
parent
commit
de084e5891

+ 1 - 2
pkg/services/sqlstore/migrator/migrations.go

@@ -1,7 +1,6 @@
 package migrator
 
 import (
-	"fmt"
 	"strings"
 )
 
@@ -113,7 +112,7 @@ func NewDropIndexMigration(table Table, index *Index) *DropIndexMigration {
 
 func (m *DropIndexMigration) Sql(dialect Dialect) string {
 	if m.index.Name == "" {
-		m.index.Name = fmt.Sprintf("%s", strings.Join(m.index.Cols, "_"))
+		m.index.Name = strings.Join(m.index.Cols, "_")
 	}
 	return dialect.DropIndexSql(m.tableName, m.index)
 }

+ 1 - 1
pkg/services/sqlstore/migrator/types.go

@@ -46,7 +46,7 @@ type Index struct {
 
 func (index *Index) XName(tableName string) string {
 	if index.Name == "" {
-		index.Name = fmt.Sprintf("%s", strings.Join(index.Cols, "_"))
+		index.Name = strings.Join(index.Cols, "_")
 	}
 
 	if !strings.HasPrefix(index.Name, "UQE_") &&