小编use*_*478的帖子

如何使用struct或variable值字段作为模板名称?

我们可以通过定义模板名称{{define "home"}},然后通过其他(父)模板加载它{{template "home"}}.

我如何通过变量值加载模板{{template .TemplateName}}.或者这不可能?

templates go go-templates

9
推荐指数
1
解决办法
2077
查看次数

我可以使用Go从一个Web应用程序设置多端口吗?

据我所知,我可以使用Golang运行简单的Web服务器,就像使用http包一样

http.ListenAndServe(PORT, nil)
Run Code Online (Sandbox Code Playgroud)

其中PORT是要侦听的TCP地址.

我可以将PORT用作PORT S,例如http.ListenAndServe(":80, :8080", nil)来自一个应用程序吗?

可能我的问题是愚蠢的,但"谁不问,他不会得到答案!"

谢谢你提前!

go

6
推荐指数
2
解决办法
3620
查看次数

标签 统计

go ×2

go-templates ×1

templates ×1