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)
This commit is contained in:
Karsten Weiss
2018-04-16 20:40:19 +02:00
parent 5d95601720
commit de084e5891
2 changed files with 2 additions and 3 deletions

View File

@@ -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)
}

View File

@@ -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_") &&