紧急:打开templates / base.html:系统找不到指定的路径

With shadynasty.biz/blog/2012/07/30/quick-and-clean-in-go link I am Trying to Create template in go programming. My project Structure is created with the Go-SDK google app engine. google_appengine/myapp/hello/hello.go file is present, then where to create template folder? I created the "template" folder in "hello" folder but getting error "panic: open templates/base.html: The system cannot find the path specified" and server stops running. What can be done?

using template on appengine is only posible if you pass the html from field, because of appengine rules you dont have access to the filesystem

here is an example

const loginTemplateHTML = `<html>
  <body>
    <form action="/login" method="post">
      <div><input name="username" type="text" /></div>
      <div><input name="password" type="password" /></div>
      <div><input type="submit" value="login"></div>
    </form>
  </body>
</html>
    `    
var loginTemplate = template.Must(template.New("Login").Parse(loginTemplateHTML))

func login (w http.ResponseWriter, r *http.Request) {
    if err := loginTemplate.Execute(w,nil); err != nil {
         http.Error(w, err.Error(), http.StatusInternalServerError)
    }
}

Actually you do have access to almost any file you put to your application folder.

You could use the ioutil to read the files: http://golang.org/pkg/io/ioutil/#ReadFile

And a point to note, you can only read files not specified by the static handler in app.yaml.

So, keep your template files in one folder and your static and directly served files in another folder.