{{range $k, $v := .Var}} {{$k}} => {{$v}} {{end}}
range...end结构内部如要使用外部的变量,比如.Var2,需要这样写:$.Var2
$.Var2
(即:在外部变量名称前加符号 “$” 即可,单独的“$”意义等同于global)
“$”
Powered by: 博客园 Copyright © 2024 蝈蝈俊 Powered by .NET 9.0 on Kubernetes