package boltcache import "sync" type storeState struct { lastLock sync.Mutex lastLogIndex uint64 } func (s *storeState) getLastLog() (index uint64) { s.lastLock.Lock() index = s.lastLogIndex s.lastLock.Unlock() return } func (s *storeState) setLastLog(index uint64) { s.lastLock.Lock() s.lastLogIndex = index s.lastLock.Unlock() }