Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant