comment.go 254 B

123456789101112131415
  1. package parser
  2. import (
  3. "strings"
  4. "github.com/emicklei/proto"
  5. )
  6. // GetComment returns content with prefix //
  7. func GetComment(comment *proto.Comment) string {
  8. if comment == nil {
  9. return ""
  10. }
  11. return "// " + strings.TrimSpace(comment.Message())
  12. }