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)
| 84 | |
| 85 | // AddComment is a convenience function to add a comment to a bug |
| 86 | func 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 | } |
no test coverage detected