In Go -- files within the same directory should belong to the same package. 
So, both main.go and a.go should be the same package E.g. package script. 
This turns out to be a really nice feature because it allows you to break 
your packages into logical pieces with very little effort.

I would suggest structuring your app like:

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
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/NousXFbUYaIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to