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

[BugFix] #104 - simulator: panic: invalid argument to Intn #126

Merged
merged 2 commits into from
Aug 10, 2022

Conversation

q131172019
Copy link
Collaborator

This PR is to simply fix the bug #104 by adding the check to ensure input command line parameters for Nodes Per RP or RP Number Per Region is greater than 0.

@@ -30,6 +30,23 @@ func main() {
flag.Parse()
}

// Input parameter error handling for c.RpNum and c.NodesPerRP
// Fix bug #104
if c.RpNum < 1 || c.NodesPerRP < 1 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this OR is not needed. since you are error and exit for those two cases, yo can just check them individually as the code below and exit if condition checks true

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to avoid using "os.Exit(1)" twice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see my second commit.

Copy link
Collaborator

@yb01 yb01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm. test simulator code.

@yb01 yb01 merged commit 0770f00 into CentaurusInfra:main Aug 10, 2022
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

Successfully merging this pull request may close these issues.

2 participants