-
Notifications
You must be signed in to change notification settings - Fork 106
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
Increase leniency of semver parsing #2742
Conversation
7eafbb6
to
d3f2402
Compare
var semVers []uint16 | ||
for _, v := range split { | ||
i, err := strconv.ParseUint(v, 10, 16) | ||
var semVers []uint16 = []uint16{0, 0, 0} |
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.
or maybe nil
?
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.
I like that this preallocates
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.
no, I mean like Option<u16>
Codecov Report
@@ Coverage Diff @@
## master #2742 +/- ##
==========================================
- Coverage 63% 62.92% -0.09%
==========================================
Files 383 383
Lines 36094 36094
==========================================
- Hits 22742 22713 -29
+ Misses 10525 10516 -9
- Partials 2827 2865 +38
Continue to review full report at Codecov.
|
mdlint is giving spurious errors [foo][0]
[0]: https://bar is not a bare url |
d3f2402
to
7e127fd
Compare
Does Go claim to use semver? |
if I search "semver," I find this https://semver.org/#spec-item-2:
and then they don't explain what "normal" refers to |
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.
alright seeing as we're elsewhere cramming the Go runtime version down parseSemVerStr
's throat, we might as well not make our node panic
7e127fd
to
938a6e8
Compare
Not all sources of semvers provide three fields. For instance, runtime.Version() will return only major and minor when it's part of a release build (usage). This fixes oasis-node startup issues.