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

Style: improve api clients comments #780

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

samlaf
Copy link
Contributor

@samlaf samlaf commented Oct 2, 2024

Small improvements to comments/docs for api clients.
Had some fun in the plane while reading the code.
Added some TODOs in a few places which might be worth checking through, perhaps we can solve some of them right away @bxue-l2

@samlaf samlaf requested a review from bxue-l2 October 2, 2024 19:22
@@ -30,6 +30,7 @@ func GenericDecodeBlob(data []byte) ([]byte, error) {
if len(data) <= 32 {
return nil, fmt.Errorf("data is not of length greater than 32 bytes: %d", len(data))
}
// TODO: why [1]? What's in [0]?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bxue-l2 you prob know this

Comment on lines +30 to +31
// TODO: all of these should be private, to prevent users from using them directly,
// which breaks encapsulation and makes it hard for us to do refactors or changes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this I personally think is a refactor worth doing... but it might break some client code... :\

Comment on lines 103 to 106
if len(data) == 0 {
// TODO: explain when/why/how this can happen
return nil, fmt.Errorf("blob has length zero")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bxue-l2 do you know?

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.

1 participant