mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -1,7 +1,6 @@
|
|||||||
package migrator
|
package migrator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -113,7 +112,7 @@ func NewDropIndexMigration(table Table, index *Index) *DropIndexMigration {
|
|||||||
|
|
||||||
func (m *DropIndexMigration) Sql(dialect Dialect) string {
|
func (m *DropIndexMigration) Sql(dialect Dialect) string {
|
||||||
if m.index.Name == "" {
|
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)
|
return dialect.DropIndexSql(m.tableName, m.index)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ type Index struct {
|
|||||||
|
|
||||||
func (index *Index) XName(tableName string) string {
|
func (index *Index) XName(tableName string) string {
|
||||||
if index.Name == "" {
|
if index.Name == "" {
|
||||||
index.Name = fmt.Sprintf("%s", strings.Join(index.Cols, "_"))
|
index.Name = strings.Join(index.Cols, "_")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.HasPrefix(index.Name, "UQE_") &&
|
if !strings.HasPrefix(index.Name, "UQE_") &&
|
||||||
|
|||||||
Reference in New Issue
Block a user