func (bs *boltStorage) LastIndex() (uint64, error) {
	tx, err := bs.db.Begin(false)
	if err != nil {
		return 0, err
	}

	defer tx.Rollback()
	curs := tx.Bucket(entriesBucket).Cursor()
	last, _ := curs.Last()
	if last == nil {
		// if we can't find a key in the bucket,
		// return 0 as last index
		return 0, nil
	}

	return bytesToUint64(last), nil
}
// LastIndex returns the index of the last entry in the log.
LastIndex returns the index of the last entry in the log.
// LastIndex returns the index of the last entry in the log .
func (bs *boltStorage) LastIndex() (uint64, error) {
	tx, err := bs.db.Begin(false)
	if err != nil {
		return 0, err
	}
	defer tx.Rollback()
	curs := tx.Bucket(entriesBucket).Cursor()
	last, _ := curs.Last()
	if last == nil {
		return 0, nil
	}
	return bytesToUint64(last), nil
}
func ( bs * boltStorage ) LastIndex ( ) ( uint64 , error ) { tx , err := bs . db . Begin ( false ) if err != nil { return 0 , err } defer tx . Rollback ( ) curs := tx . Bucket ( entriesBucket ) . Cursor ( ) last , _ := curs . Last ( ) if last == nil { return 0 , nil } return bytesToUint64 ( last ) , nil }
LastIndex returns the index of the last entry in the log.
LastIndex returns the index of the last entry in the log .
// if we can't find a key in the bucket, // return 0 as last index