Might be your dir structure…
when I run it I have the project setup as follows:
So, under your “src” dir create a directory named “test”.
then create both “images” and “templates” directories.
main.go
resides in the root of test
, your image file goes into the images dir and the testtemplate.html into the templates
dir.
from the root of the test dir you should have the following …
now run the following
go run main.go
The result I get is (using my own image file)
I highly recommend that you read the the following link, it should help explain how to do exactly what you want.
http://www.alexedwards.net/blog/serving-static-sites-with-go
I’m signing off now, going on vacation so wont be “online” for three weeks.
Regards,
John