Golang template generate array of strings

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Golang template generate array of strings



I want to generate the following



app1 && app2 && app3


app1 && app2 && app3



My template look like following


{{- range ExeApp .}} {{ .Command }} {{- end}}



My code looks like following with command which is array of strings


type App struct {
Data string
Command string
}


func ExeApp(m models) App {

switch m.Type {
case “apps":
return App{
{"# running apps",
string{“app1", “app2", “app3"}},
}




Currently its generated like


[app1 app2 app3]



And I need it like



app1 && app2 && app3 ,


app1 && app2 && app3



I try to play with the template by adding && before the .Command which doesn’t help and in addition I don’t know how to remove the array before and after the apps, any idea what I’m doing wrong here ?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

rimwVc iWgYn12pQ7vzhPd1etMXnKuK,Z1UzL0CZ0KjUKcYzvhjloD h,URhrjZ,4oT701yuTs0o3Uk5GKuLW7X7Fnm0oL8Fy mSc
2jvAcHSqQ HJ ECsY3CYg 9M0b0zHZ3PZK6Bc,mU,ZKEzRfpMur,sH2YiK,eDQ 7Vq

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham