You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Marvin Humphrey <ma...@rectangular.com> on 2014/12/01 07:29:45 UTC

[lucy-dev] Go bindings -- project organization

On Mon, Nov 17, 2014 at 1:12 PM, Marvin Humphrey <ma...@rectangular.com> wrote:

> *   Clownfish parcels are mapped 1:1 to Go packages -- i.e. there is only
>     `lucy`, while `index`, `search`, `analysis` and the like are not broken
>     out into separate packages a la Lucene's Java packages.

One consequence of this is that Clownfish-powered projects will end up on a
single GoDoc documentation page, which will be quite large for something like
Lucy.

> *   The Go package dir, which by convention takes the name of the package,
>     has been put one level down from `go` -- e.g. `$LUCYREPO/go/lucy`.
>     This allows us to put whatever junk we want into `go/`.

It's common to make a Go project with all Go files loose in the top dir of the
repo, and then the package name is derived from the last fragment of the repo
URL.  That convention won't work for Clownfish projects, since we put
everything one level down in dirs named for the host language.

By using the short parcel name to house the source files, we avoid making
people use an alias when they import the Go package.  We also give ourselve a
directory in which to put build scripts, sample files, INSTALL
instructions, etc.

For more information see "How to Write Go Code":

    https://golang.org/doc/code.html

Marvin Humphrey