var PanicOnBugs … var mu … var exemplars … var handlers … type Bug … // Reportf reports a formatted bug message. func Reportf(format string, args ...interface{ … } // Errorf calls fmt.Errorf for the given arguments, and reports the resulting // error message as a bug. func Errorf(format string, args ...interface{ … } // Report records a new bug encountered on the server. // It uses reflection to report the position of the immediate caller. func Report(description string) { … } var BugReportCount … func report(description string) { … } // Handle adds a handler function that will be called with the next // bug to occur on the server. The handler only ever receives one bug. // It is called synchronously, and should return in a timely manner. func Handle(h func(Bug)) { … } // List returns a slice of bug exemplars -- the first bugs to occur at each // callsite. func List() []Bug { … }