diff --git a/schema/dmt/operations.go b/schema/dmt/operations.go index 0f83e5da..efcedc55 100644 --- a/schema/dmt/operations.go +++ b/schema/dmt/operations.go @@ -16,11 +16,11 @@ func ConcatenateSchemas(a, b *Schema) *Schema { // The joy of having an intermediate form that's just regular data model: // we can implement this by simply using data model "copy" operations, // and the result is correct. - nb := Type.Schema.NewBuilder() - if err := datamodel.Copy(bindnode.Wrap(a, Type.Schema.Type()), nb); err != nil { + nb := Prototypes.Schema.NewBuilder() + if err := datamodel.Copy(bindnode.Wrap(a, Prototypes.Schema.Type()), nb); err != nil { panic(err) } - if err := datamodel.Copy(bindnode.Wrap(b, Type.Schema.Type()), nb); err != nil { + if err := datamodel.Copy(bindnode.Wrap(b, Prototypes.Schema.Type()), nb); err != nil { panic(err) } return bindnode.Unwrap(nb.Build()).(*Schema) diff --git a/schema/dmt/roundtrip_test.go b/schema/dmt/roundtrip_test.go index 896e2a61..053b0bc9 100644 --- a/schema/dmt/roundtrip_test.go +++ b/schema/dmt/roundtrip_test.go @@ -33,7 +33,7 @@ func testRoundtrip(t *testing.T, want string, updateFn func(string)) { crre := regexp.MustCompile(`\r?\n`) want = crre.ReplaceAllString(want, "\n") - nb := schemadmt.Type.Schema.Representation().NewBuilder() + nb := schemadmt.Prototypes.Schema.Representation().NewBuilder() err := ipldjson.Decode(nb, strings.NewReader(want)) qt.Assert(t, err, qt.IsNil) node := nb.Build().(schema.TypedNode) diff --git a/schema/dmt/schema.go b/schema/dmt/schema.go index 6b95a97f..72aecc15 100644 --- a/schema/dmt/schema.go +++ b/schema/dmt/schema.go @@ -10,7 +10,7 @@ import ( // This schema follows https://ipld.io/specs/schemas/schema-schema.ipldsch. -var Type struct { +var Prototypes struct { Schema schema.TypedPrototype } @@ -435,7 +435,7 @@ func init() { TypeSystem = ts - Type.Schema = bindnode.Prototype( + Prototypes.Schema = bindnode.Prototype( (*Schema)(nil), TypeSystem.TypeByName("Schema"), )