func (f *Formatter) indent(diff int) {
	f.level(diff)
	for i := 0; i < f.indentLevel; i++ {
		io.WriteString(f.w, f.indentSeparator)
	}
}
indent changes the indent level and writes indentation.
package protofmt
import (
	"fmt"
	"io"
	"github.com/emicklei/proto"
)
func (f *Formatter) printDoc(v proto.Visitee) {
	if hasDoc, ok := v.(proto.Documented); ok {
		if doc := hasDoc.Doc(); doc != nil {
			f.printComment(doc)
		}
	}
}
func (f *Formatter) printComment(c *proto.Comment) {
	f.nl()
	if c.Cstyle {
		fmt.Fprintln(f.w, "/*")
	}
	for i, each := range c.Lines {
		f.indent(0)
		if c.Cstyle {
			skip := (i == 0 && len(each) == 0) ||
				(i == len(c.Lines)-1 && len(each) == 0)
			if !skip {
				fmt.Fprintf(f.w, "%s\n", each)
			}
		} else {
			if c.ExtraSlash {
				fmt.Fprint(f.w, "/")
			}
			fmt.Fprintf(f.w, "//%s\n", each)
		}
	}
	if c.Cstyle {
		fmt.Fprintf(f.w, " */\n")
	}
}
func (f *Formatter) begin(stmt string, v proto.Visitee) {
	if len(f.lastStmt) > 0 && f.lastStmt != stmt && f.lastLevel == f.indentLevel {
		f.nl()
	}
	f.lastStmt = stmt
	f.printDoc(v)
	f.indent(0)
}
func (f *Formatter) beginNoDoc(stmt string, v proto.Visitee) {
	if len(f.lastStmt) > 0 && f.lastStmt != stmt && f.lastLevel == f.indentLevel {
		f.nl()
	}
	f.lastStmt = stmt
	f.indent(0)
}
func (f *Formatter) end(stmt string) {
	f.lastStmt = stmt
}