Skip to content

Clean serialize.go #84

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

Merged
merged 9 commits into from
Jan 9, 2025
Merged

Clean serialize.go #84

merged 9 commits into from
Jan 9, 2025

Conversation

phbnf
Copy link
Collaborator

@phbnf phbnf commented Jan 9, 2025

Towards #5

This PR cleans serialize.go: dedup related code moves to dedup.go. Since the remaining code is signature related, we can then rename serialize.go to signatures.go, and move

@phbnf phbnf requested a review from AlCutter January 9, 2025 14:27
signatures.go Outdated
"golang.org/x/mod/sumdb/note"

ct "github.com/google/certificate-transparency-go"
)

const millisPerNano int64 = 1000 * 1000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't there approximately zero milliseconds per nanosecond, did you mean nanosPerMilli? :)

If so, could this be ... = time.Millisecond / time.Nanosecond?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe! This is not new code, I'm blindly migrating it from structures.go. Fixed!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(did you mean to also export it?)

@phbnf phbnf force-pushed the signatures branch 2 times, most recently from ca22230 to 9e9103b Compare January 9, 2025 16:34
signatures.go Outdated
"golang.org/x/mod/sumdb/note"

ct "github.com/google/certificate-transparency-go"
)

const NanosPerMilli int64 = int64(time.Millisecond / time.Nanosecond)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to export it BTW?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woopsie, thanks. As a general comment, the repo needs a good clean-up of exported / unexported stuff as well. I don't want to do this straight away though first I'll re-organize and simplify the code, then I'll carve a few things into an internal/ directory, and then export / unexport accordingly.

@phbnf phbnf merged commit 0c2ba58 into transparency-dev:main Jan 9, 2025
7 checks passed
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.

2 participants