V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
kikyou12138
V2EX  ›  Go 编程语言

什么是 go template?

  •  
  •   kikyou12138 · 2022-06-04 20:01:07 +08:00 · 1864 次点击
    这是一个创建于 693 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最新写 k8s 的 helm chart ,说 chart 语法就是 go template 语法,想问下 go template 怎么开始学习?

    3 条回复    2022-06-05 02:23:03 +08:00
    kidlj
        1
    kidlj  
       2022-06-04 20:17:25 +08:00
    MeetTheFuture
        2
    MeetTheFuture  
       2022-06-04 21:04:32 +08:00
    模板引擎 看官网的文档
    Hieast
        3
    Hieast  
       2022-06-05 02:23:03 +08:00
    建议不要深究,照着生成的 helper 里那几种写法抄抄就好了,具体的语法的可迁移性很差,换一个模版又得重新查。
    控制流的相关概念(表达式、顺序、选择、迭代、递归)才是最具有可迁移性的,用到的时候到文档里找就可以了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5394 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 09:09 · PVG 17:09 · LAX 02:09 · JFK 05:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.