MCPcopy Create free account
hub / github.com/git-bug/git-bug / DisplayName

Method DisplayName

entities/identity/identity.go:440–451  ·  view source on GitHub ↗

DisplayName return a non-empty string to display, representing the identity, based on the non-empty values.

()

Source from the content-addressed store, hash-verified

438// DisplayName return a non-empty string to display, representing the
439// identity, based on the non-empty values.
440func (i *Identity) DisplayName() string {
441 switch {
442 case i.Name() == "" && i.Login() != "":
443 return i.Login()
444 case i.Name() != "" && i.Login() == "":
445 return i.Name()
446 case i.Name() != "" && i.Login() != "":
447 return fmt.Sprintf("%s (%s)", i.Name(), i.Login())
448 }
449
450 panic("invalid person data")
451}
452
453// Email return the last version of the email
454func (i *Identity) Email() string {

Callers

nothing calls this directly

Calls 2

NameMethod · 0.95
LoginMethod · 0.95

Tested by

no test coverage detected