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

Use standardized hash.CloneHash interface #1462

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

gdams
Copy link
Member

@gdams gdams commented Jan 7, 2025

Upstream will most likely define a standardized hash clone interface: golang/go#69521 (comment)

type CloneHash interface {
    hash.Hash
    Clone() hash.Hash
}

We should follow suite so that our hash types are compatible with upstream. The only difference with our current approach is that the new Clone method doesn't return an error, which makes sense given that other hash methods are not allowed to return an error. It is also unlikely that CNG will return an error when duplicating a hash unless there is a programmer error or the there is no memory available in the system, in which case it makes sense to panic anyway.

@gdams gdams marked this pull request as ready for review January 7, 2025 20:55
@gdams gdams force-pushed the dev/gadams/hashclone branch from a2e220a to d24267c Compare January 8, 2025 08:29
@gdams gdams requested review from qmuntal and dagood January 8, 2025 08:30
@gdams gdams force-pushed the dev/gadams/hashclone branch 3 times, most recently from 90ed5ff to f7e52d4 Compare January 8, 2025 11:19
@gdams gdams force-pushed the dev/gadams/hashclone branch from f7e52d4 to 53cc609 Compare January 8, 2025 13:04
@gdams gdams merged commit 1eb2f56 into microsoft/main Jan 8, 2025
31 checks passed
@gdams gdams deleted the dev/gadams/hashclone branch January 8, 2025 13:44
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

Successfully merging this pull request may close these issues.

4 participants