From db9d8a7512a0bd04c3d392f73449b2782fc9e3dd Mon Sep 17 00:00:00 2001 From: Eric Myhre Date: Wed, 14 Dec 2022 03:51:58 +0100 Subject: [PATCH] Export schema/dmt.TypeSystem. This is both necessary and sufficient to make it feasible for someone to easily manipulate schema DMT data as IPLD, using the IPLD libraries. That's a fairly obvious win. (If I had my way about the language of golang, I'd be able to do this while also keeping it strictly immutable. That's... not how it works, unfortunately. But as it's normal in golang to have package-scoped vars with semantic rules about no-touchy and no actual compiler-enforced support, then, we might as well not deny ourselves useful things by wishing for support for stricter rules that just doen't exist.) --- schema/dmt/schema.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/dmt/schema.go b/schema/dmt/schema.go index f8001c28..6b95a97f 100644 --- a/schema/dmt/schema.go +++ b/schema/dmt/schema.go @@ -16,7 +16,7 @@ var Type struct { //go:generate go run -tags=schemadmtgen gen.go -var schemaTypeSystem schema.TypeSystem +var TypeSystem schema.TypeSystem func init() { var ts schema.TypeSystem @@ -433,10 +433,10 @@ func init() { panic("not happening") } - schemaTypeSystem = ts + TypeSystem = ts Type.Schema = bindnode.Prototype( (*Schema)(nil), - schemaTypeSystem.TypeByName("Schema"), + TypeSystem.TypeByName("Schema"), ) }