While I love defer, I think the program is better readable and maybe even a bit faster when defer is not used when Locking/Unlocking

This commit is contained in:
tssajo
2016-07-20 01:44:14 +02:00
parent de869b3e63
commit 24425a2a9a
+1 -3
View File
@@ -30,10 +30,8 @@ func newMemdb() *memdb {
func (db *memdb) AddApp(a *app) error {
db.Lock()
defer db.Unlock()
db.Apps = append(db.Apps, a)
db.Unlock()
return nil
}