(snap *bug.Snapshot)
| 21 | } |
| 22 | |
| 23 | func NewBugSnapshot(snap *bug.Snapshot) BugSnapshot { |
| 24 | jsonBug := BugSnapshot{ |
| 25 | Id: snap.Id().String(), |
| 26 | HumanId: snap.Id().Human(), |
| 27 | CreateTime: NewTime(snap.CreateTime, 0), |
| 28 | EditTime: NewTime(snap.EditTime(), 0), |
| 29 | Status: snap.Status.String(), |
| 30 | Labels: snap.Labels, |
| 31 | Title: snap.Title, |
| 32 | Author: NewIdentity(snap.Author), |
| 33 | } |
| 34 | |
| 35 | jsonBug.Actors = make([]Identity, len(snap.Actors)) |
| 36 | for i, element := range snap.Actors { |
| 37 | jsonBug.Actors[i] = NewIdentity(element) |
| 38 | } |
| 39 | |
| 40 | jsonBug.Participants = make([]Identity, len(snap.Participants)) |
| 41 | for i, element := range snap.Participants { |
| 42 | jsonBug.Participants[i] = NewIdentity(element) |
| 43 | } |
| 44 | |
| 45 | jsonBug.Comments = make([]BugComment, len(snap.Comments)) |
| 46 | for i, comment := range snap.Comments { |
| 47 | jsonBug.Comments[i] = NewBugComment(comment) |
| 48 | } |
| 49 | |
| 50 | return jsonBug |
| 51 | } |
| 52 | |
| 53 | type BugComment struct { |
| 54 | Id string `json:"id"` |
no test coverage detected