(raw string)
| 56 | } |
| 57 | |
| 58 | func processCreate(raw string) (string, string, error) { |
| 59 | lines := strings.Split(raw, "\n") |
| 60 | |
| 61 | var title string |
| 62 | var buffer bytes.Buffer |
| 63 | for _, line := range lines { |
| 64 | if strings.HasPrefix(line, "#") { |
| 65 | continue |
| 66 | } |
| 67 | |
| 68 | if title == "" { |
| 69 | trimmed := strings.TrimSpace(line) |
| 70 | if trimmed != "" { |
| 71 | title = trimmed |
| 72 | } |
| 73 | continue |
| 74 | } |
| 75 | |
| 76 | buffer.WriteString(line) |
| 77 | buffer.WriteString("\n") |
| 78 | } |
| 79 | |
| 80 | if title == "" { |
| 81 | return "", "", ErrEmptyTitle |
| 82 | } |
| 83 | |
| 84 | message := strings.TrimSpace(buffer.String()) |
| 85 | |
| 86 | return title, message, nil |
| 87 | } |
| 88 | |
| 89 | const bugCommentTemplate = `%s |
| 90 |
no test coverage detected