chore: unnecessary use of fmt.Sprintf

This commit is contained in:
guoguangwu 2023-06-08 13:39:02 +08:00
parent e71815cf03
commit 1c574a893e
3 changed files with 7 additions and 7 deletions

View File

@ -274,7 +274,7 @@ func (m *Migration) GetSQL() (sql string) {
}
if len(m.Primary) > 0 {
sql += fmt.Sprintf(",\n PRIMARY KEY( ")
sql += ",\n PRIMARY KEY( "
}
for index, column := range m.Primary {
sql += fmt.Sprintf(" `%s`", column.Name)
@ -284,7 +284,7 @@ func (m *Migration) GetSQL() (sql string) {
}
if len(m.Primary) > 0 {
sql += fmt.Sprintf(")")
sql += ")"
}
for _, unique := range m.Uniques {
@ -295,7 +295,7 @@ func (m *Migration) GetSQL() (sql string) {
sql += ","
}
}
sql += fmt.Sprintf(")")
sql += ")"
}
for _, foreign := range m.Foreigns {
sql += fmt.Sprintf(",\n `%s` %s %s %s %s %s", foreign.Name, foreign.DataType, foreign.Unsign, foreign.Null, foreign.Inc, foreign.Default)
@ -356,7 +356,7 @@ func (m *Migration) GetSQL() (sql string) {
}
if len(m.Primary) > 0 {
sql += fmt.Sprintf("\n DROP PRIMARY KEY,")
sql += "\n DROP PRIMARY KEY,"
}
for index, unique := range m.Uniques {

View File

@ -45,7 +45,7 @@ func (p *LogProject) ListLogStore() (storeNames []string, err error) {
"x-sls-bodyrawsize": "0",
}
uri := fmt.Sprintf("/logstores")
uri := "/logstores"
r, err := request(p, "GET", uri, h, nil)
if err != nil {
return

View File

@ -120,7 +120,7 @@ func (e *Email) Bytes() ([]byte, error) {
}
// Create the body sections
if e.Text != "" {
header.Set("Content-Type", fmt.Sprintf("text/plain; charset=UTF-8"))
header.Set("Content-Type", "text/plain; charset=UTF-8")
header.Set("Content-Transfer-Encoding", "quoted-printable")
if _, err := subWriter.CreatePart(header); err != nil {
return nil, err
@ -131,7 +131,7 @@ func (e *Email) Bytes() ([]byte, error) {
}
}
if e.HTML != "" {
header.Set("Content-Type", fmt.Sprintf("text/html; charset=UTF-8"))
header.Set("Content-Type", "text/html; charset=UTF-8")
header.Set("Content-Transfer-Encoding", "quoted-printable")
if _, err := subWriter.CreatePart(header); err != nil {
return nil, err