code: func Open(stor storage.Storage, o *opt.Options) (db *DB, err error) {
  	s, err := newSession(stor, o)
  	if err != nil {
  		return
  	}
  	defer func() {
  		if err != nil {
  			s.close()
  			s.release()
  		}
  	}()
  
  	err = s.recover()
  	if err != nil {
  		if !os.IsNotExist(err) || s.o.GetErrorIfMissing() || s.o.GetReadOnly() {
  			return
  		}
  		err = s.create()
  		if err != nil {
  			return
  		}
  	} else if s.o.GetErrorIfExist() {
  		err = os.ErrExist
  		return
  	}
  
  	return openDB(s)
  }
docs: // Open opens or creates a DB for the given storage.
  // The DB will be created if not exist, unless ErrorIfMissing is true.
  // Also, if ErrorIfExist is true and the DB exist Open will returns
  // os.ErrExist error.
  //
  // Open will return an error with type of ErrCorrupted if corruption
  // detected in the DB. Use errors.IsCorrupted to test whether an error is
  // due to corruption. Corrupted DB can be recovered with Recover function.
  //
  // The returned DB instance is safe for concurrent use.
  // The DB must be closed after use, by calling Close method.