Hello,
Go newbie here
func (data map[string] interface {}) {
if len(data) == 0 {
data := make(map[string]interface{})
data["user"], _ = store.GetUser(context.Get(req, "userid").(string))
} else {
data["user"], _ = store.GetUser(context.Get(req, "userid").(string))
}
log.Println(data["user"]
hello,
im building a go web app and facing an issue with Executing templates with
custom functions
func CustomTemplateExecute(res http.ResponseWriter, req *http.Request,
templateName string, data map[string]interface{}) {
// Append common templates and data structs and execute template
var funcM
Error when i say
template.New(templates.BASE)
template: templates/base.html: "templates/base.html" is an incomplete or
empty template
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from
Files call has a "templateName" argument in it. The ParseFiles
> function only takes file paths, not template names.
>
> And templates.New takes a template name, not a file path.
>
> Hope this helps.
>
> On Sat, Mar 25, 2017 at 9:14 AM, priyank pulumati > wrote:
>
a "templateName" argument in it. The ParseFiles
> function only takes file paths, not template names.
>
> And templates.New takes a template name, not a file path.
>
> Hope this helps.
>
> On Sat, Mar 25, 2017 at 9:14 AM, priyank pulumati > wrote:
>
>>