fix golint issues, else blocks (#457)

This commit is contained in:
Kevin Wan
2021-02-09 13:50:21 +08:00
committed by GitHub
parent 42883d0899
commit 5e969cbef0
66 changed files with 341 additions and 311 deletions

View File

@@ -21,7 +21,7 @@ func DocCommand(c *cli.Context) error {
files, err := filePathWalkDir(dir)
if err != nil {
return errors.New(fmt.Sprintf("dir %s not exist", dir))
return fmt.Errorf("dir %s not exist", dir)
}
err = os.RemoveAll(dir + "/" + docDir + "/")
@@ -31,7 +31,7 @@ func DocCommand(c *cli.Context) error {
for _, f := range files {
api, err := parser.Parse(f)
if err != nil {
return errors.New(fmt.Sprintf("parse file: %s, err: %s", f, err.Error()))
return fmt.Errorf("parse file: %s, err: %s", f, err.Error())
}
index := strings.Index(f, dir)