some lint fixes

This commit is contained in:
ston1th 2021-11-05 22:10:52 +01:00
commit 9f4fda3c8b
11 changed files with 36 additions and 40 deletions

View file

@ -24,7 +24,7 @@ type DB struct {
Index *index.Index
}
func New(cfg core.Config) (db *DB, err error) {
func New(cfg *core.Config) (db *DB, err error) {
db, err = NewPlain(cfg)
if err != nil {
return
@ -48,7 +48,7 @@ func New(cfg core.Config) (db *DB, err error) {
return
}
func NewPlain(cfg core.Config) (db *DB, err error) {
func NewPlain(cfg *core.Config) (db *DB, err error) {
db = new(DB)
dbFile := filepath.Join(cfg.RunDir, storeFile)
db.store, err = store.NewBoltStore(dbFile, nil)

View file

@ -10,7 +10,7 @@ type countMutex struct {
c uint64
}
func (cm *countMutex) Lock() (uint64, uint64, bool) {
func (cm *countMutex) Lock() (max, c uint64, ok bool) {
if atomic.CompareAndSwapUint64(&cm.mu, 0, 1) {
return 0, 0, true
}