This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement compute-optimised Merkle tree #5
Implement compute-optimised Merkle tree #5
Changes from all commits
8b47625
ba45c6d
6c3df4d
51dfc3c
513a548
d1eb1ea
19635d2
9681cb8
8a53820
291f69a
3811693
88434f9
9580c06
f97d2e2
1ee39e6
7fa4dd3
5544283
668ffc9
5e2b3cc
f35ba1d
09ba921
b36d8b2
dc0cbdb
44c8c16
8690733
335b1a9
d005205
e25d724
ffbd556
5f09ca0
3992ea7
ed9e1d2
9896367
d4dd523
db5b71f
92d305c
c3d9853
e3e77ed
93a6d46
ec93126
c8ff1fa
33f6620
cb12ad1
e365be9
578066f
d026f85
f348d29
deffc31
d3cbada
511bad2
6a2864c
a36c5d7
a67555f
6f9e4ed
aeb2921
2d392fe
2bd1752
45dab71
cb65f31
a1b11b0
5300f62
d03c67a
87df869
78cfaed
8c49f13
801c3de
9738347
8549c13
cbedd41
00530c1
08f5179
4ec60e8
cb611da
8aae2d6
13ee731
fdc27b7
a95d676
5ccf7f1
2653c67
cdc57b2
358c966
cd51e37
0ab2273
da2e197
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the other place, this is equivalent to a sentinel error:
Also, it is more common / go-idiomatic to have a
Err
prefix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it better to have a special type for the error, so that users of the API can differentiate between error types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In go it is very common to use sentinel values for cases like this (this custom error is just returns a string with no further fields or context). See for instance the io package: https://golang.org/pkg/io/#pkg-variables
The custom error doesn't provide any additional value compared to a sentinel error (not to say that in other cases it could make more sense to use a custom error).
Also, worth looking at: https://blog.golang.org/go1.13-errors