2016-12-28 62 views
-1

我正在写一个解析其模板包中的模板的库。当我在示例应用程序中使用它时,它从自己的目录中读取模板,但libary中的代码失败。来自第三方库的Golang解析模板

这里是libary - https://github.com/bangarharshit/bigpipe-golang和我面临的问题与这条线 - 从LIB https://github.com/bangarharshit/bigpipe-golang/blob/master/Application.go#L66

复制代码 -

templates, err := template.ParseFiles("templates/bigpipe.html") 
if err != nil { 
    return 
} 

回答

0

一种替代soultion是从文件中复制内容到一个变量和使用template.parse而不是template.parsefiles