diff --git a/tools/goctl/api/format/format.go b/tools/goctl/api/format/format.go index 4b14c3d7..f43d2230 100644 --- a/tools/goctl/api/format/format.go +++ b/tools/goctl/api/format/format.go @@ -98,6 +98,7 @@ func ApiFormat(path string, printToConsole bool) error { _, err := fmt.Print(result) return err } + result = strings.TrimSpace(result) return ioutil.WriteFile(path, []byte(result), os.ModePerm) }