var daysFlag … var authToken … func main() { … } type Info … func (info Info) String() string { … } // stackID returns a 32-bit identifier for a stack // suitable for use in GitHub issue titles. func stackID(stack string) string { … } // newIssue creates a browser tab with a populated GitHub "New issue" // form for the specified stack. (The triage person is expected to // manually de-dup the issue before deciding whether to submit the form.) // // It returns the title. func newIssue(stack, id string, jsonURL string, counts map[Info]int64) string { … } // writeStackComment writes a stack in Markdown form, for a new GitHub // issue or new comment on an existing one. func writeStackComment(body *bytes.Buffer, stack, id string, jsonURL string, counts map[Info]int64) { … } // frameURL returns the CodeSearch URL for the stack frame, if known. func frameURL(pclntab map[string]FileLine, info Info, frame string) string { … } // searchIssues queries the GitHub issue tracker. func searchIssues(query string) (*IssuesSearchResult, error) { … } // updateIssueBody updates the body of the numbered issue. func updateIssueBody(number int, body string) error { … } // addIssueComment adds a markdown comment to the numbered issue. func addIssueComment(number int, comment string) error { … } type IssuesSearchResult … type Issue … type User … type FileLine … // readPCLineTable builds the gopls executable specified by info, // reads its PC-to-line-number table, and returns the file/line of // each TEXT symbol. func readPCLineTable(info Info) (map[string]FileLine, error) { … } // shallowClone performs a shallow clone of repo into dir at the given // 'commitish' ref (any commit reference understood by git). // // The directory dir must not already exist. func shallowClone(dir, repo, commitish string) error { … } func fileExists(filename string) bool { … } // findPredicateBlock returns the content (sans "#!stacks") of the // code block at the start of the issue body. // Logic plundered from x/build/cmd/watchflakes/github.go. func findPredicateBlock(body string) string { … } // isTerminal reports whether file is a terminal, // avoiding a dependency on golang.org/x/term. func isTerminal(file *os.File) bool { … }