In Go -- files within the same directory should belong to the same package. So, both
should be the same package E.g.
. This turns out to be a really nice feature because it allows you to break your packages into logical pieces with very little effort.
c:\gae\app.yaml
c:\gae\a\http.go
c:\gae\a\model.go
c:\gae\main\http.go
c:\gae\main\model.go
Files in the main directory would begin with package main, and files in the a directory would begin with package a
Alternatively you could put both a and main directories in a scripts directory.
On Friday, November 2, 2012 10:25:54 PM UTC-5, Lawrence Mok wrote:
Hi guys,
I'm new to "Go"... I wonder how can I separate my source files into multiple files instead of needing to keep all code into one file?
I tried but it always return results like:
2012/11/03 11:15:39 go-app-builder: Failed parsing input: failed parsing dir script: found packages main (main.go) and a (a.go) in c:\gae\script
My files structure is:
c:\gae\app.yaml
c:\gae\script\a.go
c:\gae\script\main.go
Thanks,
Lawrence