goHtmlTemplateExample
goHtmlTemplateExample copied to clipboard
runtime error
Hello, I am wondering did you run your project and worked completely? because there is a small bug that keeps popping up when I run your project:
http: panic serving 127.0.0.1:* : runtime error: invalid memory address or nil pointer dereference
now to fix this issue you have to add Must method to the template call in line 32: templates = template.Must(template.New(templateName).ParseFiles(path))
I don't know after altering the code as I mentioned before it worked well for me :)