我需要在我的程序包开头设置一个变量,稍后会用parseFiles()填充该变量,但我不确定如何设置该变量,因为它不是字符串、整数或任何通用类型。如果不得不添加某些随意的名称来设置它,那么该怎么办呢?
var templatefiles = template.New("foo") // Im having to do New("foo") just to set the variable
// Later on adding files to original variable
templatefiles.New("template name").Parse("Template text here")
templatefiles = nil
- Stephen Weinberg