chore: adjust rpc comment format (#2501)

This commit is contained in:
chen quan
2022-10-22 22:07:55 +08:00
committed by GitHub
parent c92a2d1b77
commit 22bdf0bbd5

View File

@@ -1,11 +1,15 @@
package parser
import "github.com/emicklei/proto"
import (
"strings"
"github.com/emicklei/proto"
)
// GetComment returns content with prefix //
func GetComment(comment *proto.Comment) string {
if comment == nil {
return ""
}
return "// " + comment.Message()
return "// " + strings.TrimSpace(comment.Message())
}