This is something that I asked in the past, but now it is a feature that I 
probably need for a project.

I have a main package with some data fixtures, stored in the package assets 
directory.
I want to implement a Go tool that, given a package importpath and a Data 
Source Name
(not necessarily an SQL database), loads the data fixtures in the database.

Each fixture file is named after the name of a Go struct, so the tool will 
generate, build and run a Go
source where the package is imported, the data fixture is decoded into a Go 
variable, and then
saved in the database.

This is easy, but the problem is that a main package can not be imported.
Of course I can move the related code to a normal package; and this may 
also improve the code organization.

However I think that there is no reason why a "main" package should not be 
importable, to the point that
I think that the fact that a "main" package is not importable is an 
"exception" implemented in the Go tool.

Is this true?


Thanks  Manlio

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to