From c78c4f926808b2311380b76aa080b047f931c043 Mon Sep 17 00:00:00 2001 From: Tafsuth Boumali Date: Wed, 11 Nov 2020 15:01:02 +0100 Subject: [PATCH] NB-294: expose name method --- names.go | 2 +- type.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/names.go b/names.go index 3a32c74..af30c0b 100644 --- a/names.go +++ b/names.go @@ -100,7 +100,7 @@ func (n *Names) RenameType(x interface{}, newName string, newAliases ...string) if err != nil { panic(fmt.Errorf("cannot rename %T to %q: cannot get Avro type: %v", x, newName, err)) } - name := t.name() + name := t.Name() if name == "" { panic(fmt.Errorf("cannot rename %T to %q: it does not represent an Avro definition", x, newName)) } diff --git a/type.go b/type.go index b96fd04..5a628e8 100644 --- a/type.go +++ b/type.go @@ -223,9 +223,9 @@ func (c *canonicalizer) canonicalValue1(at schema.AvroType) interface{} { } } -// name returns the fully qualified Avro name for the type, +// Name returns the fully qualified Avro Name for the type, // or the empty string if it's not a definition. -func (t *Type) name() string { +func (t *Type) Name() string { ref, ok := t.avroType.(*schema.Reference) if !ok { return ""