I am trying to load an html file from a directory and I am getting the error "open templates: no such file or directory"
My directory structure is below
/Users/{username}/go/src/app main.go
/Users/{username}/go/src/app/templates mytemplate.html
The error is coming from the line below
template.Must(template.ParseFiles(filepath.Join("templates", "mytemplate.html")))
I am new to go and just trying to get a feel for the syntax.
EDIT 1
I am building the project using the "go build" command and executing it out of the "app" directory shown above.
$GOROOT = /usr/local/go $GOPATH = /Users/{username}/go
I also updated the directory structure to integrate the $GOPATH