MCPcopy Index your code
hub / github.com/git-bug/git-bug / NewBugSnapshot

Function NewBugSnapshot

commands/cmdjson/bug.go:23–51  ·  view source on GitHub ↗
(snap *bug.Snapshot)

Source from the content-addressed store, hash-verified

21}
22
23func 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
53type BugComment struct {
54 Id string `json:"id"`

Callers 1

showJsonFormatterFunction · 0.92

Calls 7

NewTimeFunction · 0.85
NewBugCommentFunction · 0.85
NewIdentityFunction · 0.70
StringMethod · 0.65
IdMethod · 0.65
HumanMethod · 0.45
EditTimeMethod · 0.45

Tested by

no test coverage detected