newFetchInbox returns subject used as reply subject when sending pull requests as well as request ID. For non-wildcard subject, request ID is empty and passed subject is not transformed
(subj string)
| 3197 | // as well as request ID. For non-wildcard subject, request ID is empty and |
| 3198 | // passed subject is not transformed |
| 3199 | func newFetchInbox(subj string) (string, string) { |
| 3200 | if !strings.HasSuffix(subj, ".*") { |
| 3201 | return subj, "" |
| 3202 | } |
| 3203 | reqID := nuid.Next() |
| 3204 | var sb strings.Builder |
| 3205 | sb.WriteString(subj[:len(subj)-1]) |
| 3206 | sb.WriteString(reqID) |
| 3207 | return sb.String(), reqID |
| 3208 | } |
| 3209 | |
| 3210 | func subjectMatchesReqID(subject, reqID string) bool { |
| 3211 | subjectParts := strings.Split(subject, ".") |
no test coverage detected