capnproto / go-capnp

Cap'n Proto library and code generator for Go
https://capnproto.org
Other
1.22k stars 110 forks source link

RegisterSchema once per golang package #490 #544

Closed davidhubbard closed 1 year ago

davidhubbard commented 1 year ago

Fixes https://github.com/capnproto/go-capnp/issues/490 by only generating one RegisterSchema() function per $Go.package().

For example, the unit tests persistent-simple.capnp and persistent-samepkg.capnp now both have the annotation:

$Go.package("persistent_simple");

Their generated go code thus starts with:

package persistent_simple

but only one of them will include a RegisterSchema().