0
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() + ";\n"
的在这段代码我尝试新的(bytes.Buffer)改变STR的价值,以新(token.FileSet),因为Fprint的说法requier ;
func Fprint(output io.Writer, fset *token.FileSet, node interface{}) os.Error //latest ver.
现在,我在错误str.String()因为str没有方法String()。 我无法更新我的代码以便在最新版本的Go中运行,因为更改了printer.Fprint()
如何解决此问题?如何修改printer.Fprint在旧版本上都可以运行最新版本,请