go-zero/tools/goctl/rpc/parser/comment.go

16 lines
254 B
Go
Raw Normal View History

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