Skip to content

Conversation

@Kybxd
Copy link
Collaborator

@Kybxd Kybxd commented Aug 29, 2025

Method Name() of class Messager is static in cpp loader, so access to its name is allowed without a messager instance. We should keep same logic in go.

@Kybxd Kybxd changed the title feat: allow calling Name() when messager is nil go: allow calling Name() when messager is nil Aug 29, 2025
return string(x.data.ProtoReflect().Descriptor().Name())
}
return ""
return string((*protoconf.HeroConf)(nil).ProtoReflect().Descriptor().Name())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is subtle. As it depends all three funcs can process nil receiver well:

  • ProtoReflect()
  • Descriptor()
  • Name()

@wenchy wenchy marked this pull request as draft September 9, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants