-
Notifications
You must be signed in to change notification settings - Fork 644
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
Can not distinguish between "does not exist" and "has no value" #726
Comments
For the case of "does not exist", For the case "has no value", The only known minor problem is that even you write a |
For example,
|
In short, no matter what value you write into bbolt, when you read it back, you will always get The only exception is that when you write a Will raise a PR to add a known issue. |
Completed in #730 |
I wrote the pwned passwords into a bucket. Because I only need to know if the hash exists, I wrote an empty value into the bucket.
Now I tried to find a hash, but I had to realize that Go does not distinguish between an empty array and
nil
. The problem is: Bolt returnsnil
to indicate that a key does not exist. This is a problem because of Go's limitation.How to store keys without values in order to check just for existence?
I think Bucket.Get needs to return an additional boolean or Bucket needs an additional function to check just for existence.
Go itself also indicates the existence of a key in a map by an additional boolean:
The text was updated successfully, but these errors were encountered: