openidec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 082d5f1d3f5e752acce6508cc9fe3a58fa099452
parent 83c57e6a164b9ab3867b6ecb03e92dd3022ebefb
Author: Petr Razumov <razumov.petr@wb.ru>
Date:   Tue,  4 Apr 2023 15:08:00 +0300

fix: redundant use of fmt.Sprintf()

Diffstat:
Mcmd/idecd/main.go | 8++++----
Mii/db.go | 2+-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmd/idecd/main.go b/cmd/idecd/main.go @@ -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" } diff --git a/ii/db.go b/ii/db.go @@ -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.