MCPcopy Create free account
hub / github.com/git-bug/git-bug / Create

Function Create

entities/bug/op_create.go:104–115  ·  view source on GitHub ↗

Create is a convenience function to create a bug

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

Source from the content-addressed store, hash-verified

102
103// Create is a convenience function to create a bug
104func Create(author identity.Interface, unixTime int64, title, message string, files []repository.Hash, metadata map[string]string) (*Bug, *CreateOperation, error) {
105 b := NewBug()
106 op := NewCreateOp(author, unixTime, title, message, files)
107 for key, val := range metadata {
108 op.SetMetadata(key, val)
109 }
110 if err := op.Validate(); err != nil {
111 return nil, op, err
112 }
113 b.Append(op)
114 return b, op, nil
115}

Callers 4

NewRawMethod · 0.92
TestCreateFunction · 0.85
TestIDFunction · 0.85

Calls 5

AppendMethod · 0.95
NewBugFunction · 0.85
NewCreateOpFunction · 0.85
SetMetadataMethod · 0.65
ValidateMethod · 0.65

Tested by 2

TestCreateFunction · 0.68
TestIDFunction · 0.68