feat: add validate command

This commit is contained in:
mzz2017
2023-02-04 22:21:27 +08:00
parent a6d2628505
commit 5af9c9d46e
3 changed files with 39 additions and 20 deletions

View File

@ -45,7 +45,7 @@ func Run(log *logrus.Logger) (err error) {
internal.AutoSu()
// Read config from --config cfgFile.
param, err := readConfig()
param, err := readConfig(cfgFile)
if err != nil {
return fmt.Errorf("readConfig: %w", err)
}
@ -100,7 +100,7 @@ func Run(log *logrus.Logger) (err error) {
return nil
}
func readConfig() (params *config.Params, err error) {
func readConfig(cfgFile string) (params *config.Params, err error) {
b, err := os.ReadFile(cfgFile)
if err != nil {
return nil, err