I have been following Google App Engine's Go Tutorial.
According to the tutorial, I should create a root project directory and all source files related to the project should go into this directory. Consequentially, my workspace looks like this:
/MyProject
/router
router.go
/items
items.go
When I try to refer to items.go in router.go like this:
router.go
import(
"items"
)
func itemsHandler(writer http.ResponseWriter, request * http.Request){
anItem := items.Item{Id: 245,Name: "Chocolate",Price: 1.50};
}
The app fails to compile because items is undefined
and now I am very confused about how a Go project on Google App Engine is supposed to be organised. What I'd like to know is
Is my project directory supposed to be located in the Go SDK's
gopath
directory or can it be located anywhere? The Tutorial did not make this clear.What's the structure for a Go App Engine Project and how do I import the source files?