Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StoreOptions parameter needed for both OpenStore and OpenCollection? #63

Open
gertcuykens opened this issue Jun 12, 2019 · 0 comments
Open

Comments

@gertcuykens
Copy link

gertcuykens commented Jun 12, 2019

Hi, for me it's not clear why both OpenStore and OpenCollection need a StoreOptions parameter? Is there a case to use different StoreOptions for OpenStore and store.OpenCollection? If they need to be the same isn't it safer to only set StoreOptions on theOpenStore call so no bug's can ocurre when StoreOptions get changed between the two calls?

func OpenStoreCollection(dir string, options StoreOptions,
	persistOptions StorePersistOptions) (*Store, Collection, error) {
	store, err := OpenStore(dir, options)
	if err != nil {
		return nil, nil, err
	}

	coll, err := store.OpenCollection(options, persistOptions)
	if err != nil {
		store.Close()
		return nil, nil, err
	}

	return store, coll, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant