// Format returns a go.mod file as a byte slice, formatted in standard style. func Format(f *FileSyntax) []byte { … } type printer … // printf prints to the buffer. func (p *printer) printf(format string, args ...interface{ … } // indent returns the position on the current line, in bytes, 0-indexed. func (p *printer) indent() int { … } // newline ends the current line, flushing end-of-line comments. func (p *printer) newline() { … } // trim removes trailing spaces and tabs from the current line. func (p *printer) trim() { … } // file formats the given file into the print buffer. func (p *printer) file(f *FileSyntax) { … } func (p *printer) expr(x Expr) { … } func (p *printer) tokens(tokens []string) { … }