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

main : check --config-check should has --config flag specified first. #11855

Merged
merged 5 commits into from
Aug 26, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tidb-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ func loadConfig() string {
return err.Error()
}
terror.MustNil(err)
} else {
// configCheck should have the config file specified.
if *configCheck {
fmt.Fprintln(os.Stderr, "config check failed", errors.New("no config file specified for config-check"))
os.Exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use MustNil?

Copy link
Contributor Author

@AilinKid AilinKid Aug 24, 2019

Choose a reason for hiding this comment

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

Em... it's not in test file .
This is same as previous config valid code when tidb start, Fprintln to Stderr with err.
Cause user specified no config file, we new an error here.

Refer to this:
the right case, the fail case is what I have added.

a previous fail case

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it isn't the test file, you can see MustNil is called on line 347.

Copy link
Contributor Author

@AilinKid AilinKid Aug 24, 2019

Choose a reason for hiding this comment

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

Enen, got it. I've update my upper comment.

}
}
return ""
}
Expand Down