[go-nuts] Re: Golang Templates

2020-07-16 Thread Brian Candler
The next thing to do is to boil this down to a standalone test case in the golang playground. Are you saying the template is not being expanded correctly at line 155? https://github.com/ali2210/WizDwarf/blob/master/main.go#L155 Are you sure the value of LifeCode is what you expect? Try printin

[go-nuts] Re: Golang Templates

2020-07-15 Thread Ali Hassan
https://github.com/ali2210/WizDwarf/blob/master/visualize.html On Wednesday, July 15, 2020 at 3:14:51 PM UTC+5, Ali Hassan wrote: > > > {{range .}} > {{if ne .Symbol " "}} >{{.Symbol}} > {{end}} >{{end}} > > > var div=document.getElementById('List'); > var point = div.

[go-nuts] Re: Golang Templates

2020-07-15 Thread Ali Hassan
yes it is https://github.com/ali2210/WizDwarf/blob/master/main.go [line: 150-158] On Wednesday, July 15, 2020 at 3:14:51 PM UTC+5, Ali Hassan wrote: > > > {{range .}} > {{if ne .Symbol " "}} >{{.Symbol}} > {{end}} >{{end}} > > > var div=document.getElementById('List');

[go-nuts] Re: Golang Templates

2020-07-15 Thread Ali Hassan
Yes it is func Visualize(w http.ResponseWriter, r *http.Request){ temp := template.Must(template.ParseFiles("visualize.html")) if r.Method == "GET" { fmt.Println("Url:", r.URL.Path) fmt.Println("Method:" + r.Method) temp.Execute(w,LifeCode) } } On Wednesday, July 15, 2020 at 3:14:51 PM UTC+5, Al

[go-nuts] Re: Golang Templates

2020-07-15 Thread Ali Hassan
Yeah this is Javascript and Go https://github.com/ali2210/WizDwarf/blob/master/visualize.html https://github.com/ali2210/WizDwarf/blob/master/js/visual.js func Visualize(w http.ResponseWriter, r *http.Request){ temp := template.Must(template.ParseFiles("visualize.html")) if r.Method == "GET

[go-nuts] Re: Golang Templates

2020-07-15 Thread Brian Candler
What language is that code written in? It looks more like Javascript than Go to me. If you have a problem with some Go code, please can you show the Go code - ideally as a self-contained runnable example at play.golang.org -- You received this message because you are subscribed to the Google