MCPcopy
hub / github.com/apache/answer / AnswerURL

Function AnswerURL

pkg/display/url.go:44–52  ·  view source on GitHub ↗

AnswerURL get answer url

(permalink int, siteUrl, questionID, title, answerID string)

Source from the content-addressed store, hash-verified

42
43// AnswerURL get answer url
44func AnswerURL(permalink int, siteUrl, questionID, title, answerID string) string {
45 if permalink == constant.PermalinkQuestionIDAndTitle ||
46 permalink == constant.PermalinkQuestionID {
47 answerID = uid.DeShortID(answerID)
48 } else {
49 answerID = uid.EnShortID(answerID)
50 }
51 return QuestionURL(permalink, siteUrl, questionID, title) + "/" + answerID
52}
53
54// CommentURL get comment url
55func CommentURL(permalink int, siteUrl, questionID, title, answerID, commentID string) string {

Callers 3

NewAnswerTemplateMethod · 0.92
CommentURLFunction · 0.85

Calls 3

DeShortIDFunction · 0.92
EnShortIDFunction · 0.92
QuestionURLFunction · 0.85

Tested by

no test coverage detected