如何修改打印机。旧版本的Fprint可以在最新版本的Go上运行

str := new(bytes.Buffer) //old code
printer.Fprint(str, c)   //old code 
str := new(token.FileSet) //new code
printer.Fprint(os.Stdout, str, c) //new code    

source += "\t" + str.String() + ";
"   

In this code i try to change str's value from new(bytes.Buffer) to new(token.FileSet) because Fprint's argument requier;
func Fprint(output io.Writer, fset *token.FileSet, node interface{}) os.Error //latest ver.
now, i'm stucking in error str.String() because str don't have method String(). I cann't update my code for run in latest version of Go because a changed of printer.Fprint()
How to volve this?

Here's a sample program.

package main

import (
    "bytes"
    "fmt"
    "go/parser"
    "go/printer"
    "go/token"
)

func main() {
    const src = `package main
    func main() {}
    `

    fset := token.NewFileSet()
    ast, err := parser.ParseFile(fset, "", src, parser.ParseComments)
    if err != nil {
        panic(err)
    }

    var buf bytes.Buffer
    printer.Fprint(&buf, fset, ast)

    fmt.Print(buf.String())
}

Output:

package main

func main() {}