Skip to content

Commit

Permalink
Merge pull request #98 from heetch/NB-294/expose-name-method
Browse files Browse the repository at this point in the history
expose Name method in type.go
  • Loading branch information
tafsuth authored Nov 11, 2020
2 parents f06879c + c78c4f9 commit 0088b1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion names.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
4 changes: 2 additions & 2 deletions type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit 0088b1d

Please sign in to comment.