我有兴趣根据某些条件向 GO 模板添加内容。我有一个这样定义的结构 -{ "resourceActions": { "update": { "input": null, "output": "instance", }, "stop": { "input": "instanceStop", "output": "instance", }, "console": { "input": "instanceConsoleInput", "output": "instanceConsole", }, "restart": { "input": null, "output": "instance", }, "remove": { "input": null, "output": "instance", },}我需要迭代“resourceActions”,如果其中定义的操作(如更新、重启等)的输入为空,则生成“A()”,否则生成 A(input *{inputVAL})例子 -{ for Update - A() for stop - A(input *instanceStop) for console - A(input *instanceConsoleInput) for restart - A()}我怎样才能在 GO-tempaltes 中做到这一点
1 回答
- 1 回答
- 0 关注
- 155 浏览
添加回答
举报
0/150
提交
取消