MCPcopy
hub / github.com/cli/cli / minimalNode

Function minimalNode

pkg/cmd/discussion/client/client_test.go:24–58  ·  view source on GitHub ↗

minimalNode returns a minimal JSON discussion node with the given id and title.

(id, title string)

Source from the content-addressed store, hash-verified

22
23// minimalNode returns a minimal JSON discussion node with the given id and title.
24func minimalNode(id, title string) string {
25 return heredoc.Docf(`
26 {
27 "id": %q,
28 "number": 1,
29 "title": %q,
30 "body": "",
31 "url": "",
32 "closed": false,
33 "stateReason": "",
34 "isAnswered": false,
35 "answerChosenAt": "0001-01-01T00:00:00Z",
36 "author": {
37 "__typename": "User",
38 "login": "alice"
39 },
40 "category": {
41 "id": "C1",
42 "name": "General",
43 "slug": "general",
44 "emoji": "",
45 "isAnswerable": false
46 },
47 "answerChosenBy": null,
48 "labels": {
49 "nodes": []
50 },
51 "reactionGroups": [],
52 "createdAt": "2024-01-01T00:00:00Z",
53 "updatedAt": "2024-01-01T00:00:00Z",
54 "closedAt": "0001-01-01T00:00:00Z",
55 "locked": false
56 }
57 `, id, title)
58}
59
60// minimalNodes returns count comma-separated minimal JSON discussion nodes.
61func minimalNodes(count int) string {

Callers 3

minimalNodesFunction · 0.85
TestListFunction · 0.85
TestSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected