xpoa: parameter version works compatibly with int and string type#286
Merged
Conversation
Omkaka09
approved these changes
Nov 15, 2021
icexin
reviewed
Nov 16, 2021
| } | ||
|
|
||
| // ParseVersion 支持string格式和int格式的version type | ||
| func ParseVersion(cfg string) (int64, error) { |
Contributor
There was a problem hiding this comment.
这里的逻辑可以换成这样:
- unmarshal int,如果成功直接返回
- unmarshal str,如果失败返回错误
- 转换 str 到 int
Codecov Report
@@ Coverage Diff @@
## master #286 +/- ##
==========================================
+ Coverage 46.49% 46.52% +0.02%
==========================================
Files 136 136
Lines 12126 12132 +6
==========================================
+ Hits 5638 5644 +6
+ Misses 5321 5319 -2
- Partials 1167 1169 +2
Continue to review full report at Codecov.
|
icexin
approved these changes
Nov 17, 2021
aucusaga
added a commit
to aucusaga/xupercore
that referenced
this pull request
Nov 18, 2021
…enAtomFoundation#286) * xpoa: parameter version works compatibly with int and string type.
vantinfy
pushed a commit
to superconsensus/matrixcore
that referenced
this pull request
Jan 26, 2022
…enAtomFoundation#286) * xpoa: parameter version works compatibly with int and string type. (cherry picked from commit e9bc306)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes # (issue)
Type of change
Please delete options that are not relevant.