Add remote links to the ticket struct
This commit is contained in:
parent
e3e22e071a
commit
bd98139059
2 changed files with 12 additions and 6 deletions
|
@ -104,9 +104,11 @@ func parseGrepLine(line string) (*model.Ticket, error) {
|
||||||
text := strings.Join(parts[2:], "")
|
text := strings.Join(parts[2:], "")
|
||||||
|
|
||||||
return &model.Ticket{
|
return &model.Ticket{
|
||||||
"filename": filename,
|
Data: map[string]interface{}{
|
||||||
"lineNo": lineNo,
|
"filename": filename,
|
||||||
"text": text,
|
"lineNo": lineNo,
|
||||||
|
"text": text,
|
||||||
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,17 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Ticket map[string]interface{}
|
type Ticket struct {
|
||||||
|
GithubLink string `json:"githubLink,omitempty"`
|
||||||
|
JiraLink string `json:"jiraLink,omitempty"`
|
||||||
|
Data map[string]interface{} `json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
func RemoveDuplicateTickets(tickets []*Ticket, fileOnly bool) []*Ticket {
|
func RemoveDuplicateTickets(tickets []*Ticket, fileOnly bool) []*Ticket {
|
||||||
ticketMap := map[string]*Ticket{}
|
ticketMap := map[string]*Ticket{}
|
||||||
for _, t := range tickets {
|
for _, t := range tickets {
|
||||||
filename, _ := (*t)["filename"].(string)
|
filename, _ := t.Data["filename"].(string)
|
||||||
lineNo, _ := (*t)["lineNo"].(int)
|
lineNo, _ := t.Data["lineNo"].(int)
|
||||||
if fileOnly {
|
if fileOnly {
|
||||||
ticketMap[filename] = t
|
ticketMap[filename] = t
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue