if you want to bundle html/templates you need to include them as constant strings inside your source code:
const tmpl = `<html....`
Then they'll be inside your executable/package always and available when goinstall'd
Brian
Hard coding paths isn't the best way to handle template files in a web
application.
You could write your app in a way that the function called to parse
the templates files take a parameter with the base path of your
template directories. Then in you app you declare a flag and use that
to discover the path (providing a good default).
This can be used for static files, etc...
If you will hard code the path, probably you should use the
alternative pointed by Andrew.
--
André Moraes
http://andredevchannel.blogspot.com/
--
#!/bin/bash
# usage: goify package identifier source > outfile
echo "package $1"
echo -n "const $2 = "'`'
sed 's/`/`+"`"+`/g' $3
echo '`'
--
For example, this command line:
goify foo bar index.html
produces this output:
package foo
const bar = `index.html contents`
Andrew