簡體   English   中英

如何在變量賦值中連接字符串?

[英]How do I concatenate strings inside a variable assignment?

我正在嘗試將函數的輸出分配給 var 並同時附加到字符串,但無法找出正確的語法。

這些示例都不起作用:

{{- $myvar := include "mychart.helper" . "-myprefix" -}}
{{- $myvar := {{include "mychart.helper" .}} "-myprefix" -}}
{{- $myvar := (include "mychart.helper" .) "-myprefix" -}}

似乎正確的方法是使用 print() 函數

{{- $myvar := print (include "mychart.helper" .) "-myprefix" -}}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM