我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在Golang中JS转义模板

I have a template and I want to JS escape the output to inject into another template. I could use template.JSEscape to do this after I've executed the template but it would seem more efficient to do it in one step, within a template.

I'd like to do something like...

var x = "{{js}}...some other template...{{end}}"

Is this possible?

近期文章

  • 递归旅行推销员喜欢去计算
  • 基本的客户端/服务器体系结构和交互
  • 在Go中测试连接到db的处理程序
  • Mongo如何加入两个集合并在第二个集合上添加条件
  • App Engine:执行-延迟
  • Raspberry Pi GPIO和IRQ处理
  • 将带有库的可执行二进制文件嵌入到golang应用程序中并运行它
  • 标头http未传送到我的API
  • 在Go中解组可返回空白输出
  • 如何批量更改GO软件包的别名?
  • Goapp服务-警告:文件过多
  • 使用codegangsta / cli捕获命令标志变量
  • 无法从Stripe获得卡牌
  • 如何在Golang中使用成员函数正确模拟结构?
  • 如何使用Golang将变量放入电子邮件正文中?
  • 编译到Android:pthread_key_create的无效签名
  • 如何使用反射制作多维数组或切片
  • 我可以使用s3manager重命名s3上的大文件还是小文件?
  • 如何在C ++中使用GOlang方法?
  • 在API Rest golang中发送cookie

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华