Re: [go-nuts] templates in html

2021-10-26 Thread Денис Мухортов
Thanks вт, 26 окт. 2021 г. в 18:32, Marcin Romaszewicz : > Have a look at this: > https://pkg.go.dev/html/template#Template.Funcs > > You need to provide a map of function names to function references to the > template engine, otherwise, it has no idea what "stoneShop" is, because all > it sees i

Re: [go-nuts] templates in html

2021-10-26 Thread Marcin Romaszewicz
Have a look at this: https://pkg.go.dev/html/template#Template.Funcs You need to provide a map of function names to function references to the template engine, otherwise, it has no idea what "stoneShop" is, because all it sees is an interface{} and has no context to know that it's a function. This

[go-nuts] templates in html

2021-10-26 Thread Денис Мухортов
I need to pass data from the map[string]interface{} through the template I dont know why, but I catch the error: template: stone-card.html:2: function "stoneShop" not defined. Code in go: files := []string{ dirWithHTML + "index.html", dirWithHTML + "stone-card.html",