(b *BugCache)
| 38 | } |
| 39 | |
| 40 | func NewBugExcerpt(b *BugCache) *BugExcerpt { |
| 41 | snap := b.Snapshot() |
| 42 | participantsIds := make([]entity.Id, 0, len(snap.Participants)) |
| 43 | for _, participant := range snap.Participants { |
| 44 | participantsIds = append(participantsIds, participant.Id()) |
| 45 | } |
| 46 | |
| 47 | actorsIds := make([]entity.Id, 0, len(snap.Actors)) |
| 48 | for _, actor := range snap.Actors { |
| 49 | actorsIds = append(actorsIds, actor.Id()) |
| 50 | } |
| 51 | |
| 52 | e := &BugExcerpt{ |
| 53 | id: b.Id(), |
| 54 | CreateLamportTime: b.CreateLamportTime(), |
| 55 | EditLamportTime: b.EditLamportTime(), |
| 56 | CreateUnixTime: b.FirstOp().Time().Unix(), |
| 57 | EditUnixTime: snap.EditTime().Unix(), |
| 58 | AuthorId: snap.Author.Id(), |
| 59 | Status: snap.Status, |
| 60 | Labels: snap.Labels, |
| 61 | Actors: actorsIds, |
| 62 | Participants: participantsIds, |
| 63 | Title: snap.Title, |
| 64 | LenComments: len(snap.Comments), |
| 65 | CreateMetadata: b.FirstOp().AllMetadata(), |
| 66 | } |
| 67 | |
| 68 | return e |
| 69 | } |
| 70 | |
| 71 | func (b *BugExcerpt) setId(id entity.Id) { |
| 72 | b.id = id |
nothing calls this directly
no test coverage detected