You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
393 B

package main
import "fmt"
type Identity struct {
Name string
Email string
Key string
}
func (i Identity) String() string {
return fmt.Sprintf("%s - %s", i.SigningKey(), i.Author())
}
func (i Identity) Author() string {
return fmt.Sprintf("%s <%s>", i.Name, i.Email)
}
func (i Identity) SigningKey() string {
if len(i.Key) < 16 {
return i.Key
}
return i.Key[len(i.Key)-16:]
}