sách gpt4 ăn đã đi

templates - {{template "base"}} 和 {{template "base".}} 在 go-gin 中的区别

In lại 作者:数据小太阳 更新时间:2023-10-29 03:12:29 29 4
mua khóa gpt4 giày nike

{{template "base"}}{{template "base".}} 有什么区别?

我用的是go-gin,两者都可以正常运行。我在文档中找不到关于此的任何描述。

câu trả lời hay nhất

từ godoc text/template :

{{template "name"}}
The template with the specified name is executed with nil data.

{{template "name" pipeline}}
The template with the specified name is executed with dot set to the value of the pipeline.

Vì vậy {{template "base"}} 调用模板 căn cứ,上下文中没有数据(当然,全局仍然可用),并且 {{template "base".}} 使用调用时范围内的任何数据调用它。

关于templates - {{template "base"}} 和 {{template "base".}} 在 go-gin 中的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47686178/

29 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress