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

Function AddComment

entities/bug/op_add_comment.go:86–96  ·  view source on GitHub ↗

AddComment is a convenience function to add a comment to a bug

(b Interface, author identity.Interface, unixTime int64, message string, files []repository.Hash, metadata map[string]string)

Source from the content-addressed store, hash-verified

84
85// AddComment is a convenience function to add a comment to a bug
86func AddComment(b Interface, author identity.Interface, unixTime int64, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *AddCommentOperation, error) {
87 op := NewAddCommentOp(author, unixTime, message, files)
88 for key, val := range metadata {
89 op.SetMetadata(key, val)
90 }
91 if err := op.Validate(); err != nil {
92 return entity.UnsetCombinedId, nil, err
93 }
94 b.Append(op)
95 return entity.CombineIds(b.Id(), op.Id()), op, nil
96}

Callers 2

AddCommentRawMethod · 0.92
commentFunction · 0.92

Calls 6

CombineIdsFunction · 0.92
NewAddCommentOpFunction · 0.85
SetMetadataMethod · 0.65
ValidateMethod · 0.65
AppendMethod · 0.65
IdMethod · 0.65

Tested by

no test coverage detected