fix: redundant use of fmt.Sprintf()

pull/2/head
Petr Razumov 2023-04-04 15:08:00 +03:00
parent 83c57e6a16
commit 082d5f1d3f
2 changed files with 5 additions and 5 deletions

View File

@ -33,24 +33,24 @@ func PointMsg(edb *ii.EDB, db *ii.DB, udb *ii.UDB, pauth string, tmsg string) st
m, err := ii.DecodeMsgline(tmsg, true)
if err != nil {
ii.Error.Printf("Receive point msg: %s", err)
return fmt.Sprintf("%s", err)
return err.Error()
}
if r, _ := m.Tag("repto"); r != "" {
if db.Lookup(r) == nil {
ii.Error.Printf("Receive point msg with wrong repto.")
return fmt.Sprintf("Receive point msg with wrong repto.")
return "Receive point msg with wrong repto."
}
}
if !edb.Allowed(m.Echo) {
ii.Error.Printf("This echo is disallowed")
return fmt.Sprintf("This echo is disallowed")
return "This echo is disallowed"
}
m.From = udb.Name(pauth)
m.Addr = fmt.Sprintf("%s,%d", db.Name, udb.Id(pauth))
if err := db.Store(m); err != nil {
ii.Error.Printf("Store point msg: %s", err)
return fmt.Sprintf("%s", err)
return err.Error()
}
return "msg ok"
}

View File

@ -112,7 +112,7 @@ func (db *DB) IndexPath() string {
// Return path to database itself
func (db *DB) BundlePath() string {
return fmt.Sprintf("%s", db.Path)
return db.Path
}
// Returns path to lock.