You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: print.go
    path of file: ./repos/k6/vendor/github.com/jhump/protoreflect/desc/protoparse/ast
    
    the code of the file until where you have to start completion: package ast

import "io"

// Print prints the given AST node to the given output. This operation
// basically walks the AST and, for each TerminalNode, prints the node's
// leading comments, leading whitespace, the node's raw text, and then
// any trailing comments. If the given node is a *FileNode, it will then
// also print the file's FinalComments and FinalWhitespace.
func Print(w io.Writer, node Node) error {
	sw, ok := w.(stringWriter)
	if !ok {
		sw = &strWriter{w}
	}
	var err error
	Walk(node, func(n Node) (bool, VisitFunc) {
		if err != nil {
			return false, nil
		}
		token, ok := n.(TerminalNode)
		if !ok {
			return true, nil
		}

		err = printComments(sw, token.LeadingComments())
		i
    
func Print(w io.Writer, node Node) error {
	sw, ok := w.(stringWriter)
	if !ok {
		sw = &strWriter{w}
	}
	var err error
	Walk(node, func(n Node) (bool, VisitFunc) {
		if err != nil {
			return false, nil
		}
		token, ok := n.(TerminalNode)
		if !ok {
			return true, nil
		}

		err = printComments(sw, token.LeadingComments())
		if err != nil {
			return false, nil
		}

		_, err = sw.WriteString(token.LeadingWhitespace())
		if err != nil {
			return false, nil
		}

		_, err = sw.WriteString(token.RawText())
		if err != nil {
			return false, nil
		}

		err = printComments(sw, token.TrailingComments())
		return false, nil
	})
	if err != nil {
		return err
	}

	if file, ok := node.(*FileNode); ok {
		err = printComments(sw, file.FinalComments)
		if err != nil {
			return err
		}
		_, err = sw.WriteString(file.FinalWhitespace)
		return err
	}

	return nil
}