// PrintText emits diagnostics as plain text to w. // // If contextLines is nonnegative, it also prints the // offending line, plus that many lines of context // before and after the line. func (g *Graph) PrintText(w io.Writer, contextLines int) error { … } func writeTextDiagnostics(w io.Writer, roots []*Action, contextLines int) error { … } // PrintJSON emits diagnostics in JSON form to w. // Diagnostics are shown only for the root nodes, // but errors (if any) are shown for all dependencies. func (g *Graph) PrintJSON(w io.Writer) error { … } func writeJSONDiagnostics(w io.Writer, roots []*Action) error { … }