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

Avoid using strings as types #16

Open
arnaubennassar opened this issue Jul 22, 2021 · 0 comments
Open

Avoid using strings as types #16

arnaubennassar opened this issue Jul 22, 2021 · 0 comments

Comments

@arnaubennassar
Copy link
Contributor

In many parts of the code strings are used instead of the actual types, this leads to all sorts of errors and users need to have a deeper understanding of everything. For instance should I send "hez:0x347943..." or 0x347943....

We should take advantage of strong types. We love Go and not JS for many reasons, and this is for sure one of them. JSON formatting should be kept at marshaling level when sending to the API or we could use String() when logging stuff, but we should avoid as much as possible this in public methods / structs.

In this drafted PR I encountered some problems precisely because of this #11

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