package apptype ConfigSet struct { installed bool}import ( "fmt" "html/template" "net/http")func init() { config := ConfigSet{} // -------------------------------------- // // CONFIGURATION // // -------------------------------------- // // Change to "true" after configuration is done! config.installed = false // -------------------------------------- // // END CONFIGURATION // // -------------------------------------- // http.HandleFunc("/", index) http.HandleFunc("/index.php", index)}func index(w http.ResponseWriter, r *http.Request) { if config.installed == false { w.Header().Set("Location", "/install/") return }}我似乎無法弄清楚為什么這行不通。我得到的錯誤是:2012/05/21 13:22:01 go-app-builder: Failed parsing input (1 error)2012/05/21 13:22:01 /root/TravianGAE/app/app.go:7:1: expected declaration, found 'import'我不明白,我應該在那兒聲明什么嗎?
- 1 回答
- 0 關注
- 234 瀏覽
添加回答
舉報
0/150
提交
取消