I have a very long printf
call in a Go template. Example:
{{ printf "mongodb://%s:%s@%s/%s?authSource=admin&replicaSet=%s&readPreference=nearest&w=majority" .Values.rocketchat.mongo.username .Values.rocketchat.mongo.password .Values.rocketchat.mongo.database .Values.mongodb-replicaset.replicaSetName | b64enc | quote }}
How can I split this across multiple lines (like below)?
{{ printf "mongodb://%s:%s@%s/%s?authSource=admin&replicaSet=%s&readPreference=nearest&w=majority"
.Values.rocketchat.mongo.username
.Values.rocketchat.mongo.password
.Values.rocketchat.mongo.database
.Values.mongodb-replicaset.replicaSetName
| b64enc | quote }}
This cannot be done. From the text/template
documentation:
Except for raw strings, actions may not span newlines, although comments can.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With