MCPcopy Create free account
hub / github.com/gogs/gogs / CreateComment

Function CreateComment

internal/database/comment.go:320–333  ·  view source on GitHub ↗

CreateComment creates comment of issue or commit.

(opts *CreateCommentOptions)

Source from the content-addressed store, hash-verified

318
319// CreateComment creates comment of issue or commit.
320func CreateComment(opts *CreateCommentOptions) (comment *Comment, err error) {
321 sess := x.NewSession()
322 defer sess.Close()
323 if err = sess.Begin(); err != nil {
324 return nil, err
325 }
326
327 comment, err = createComment(sess, opts)
328 if err != nil {
329 return nil, err
330 }
331
332 return comment, sess.Commit()
333}
334
335// CreateIssueComment creates a plain issue comment.
336func CreateIssueComment(doer *User, repo *Repository, issue *Issue, content string, attachments []string) (*Comment, error) {

Callers 2

CreateIssueCommentFunction · 0.70
CreateRefCommentFunction · 0.70

Calls 1

createCommentFunction · 0.85

Tested by

no test coverage detected