aboutsummaryrefslogtreecommitdiffstats
path: root/bug/person.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/person.go')
-rw-r--r--bug/person.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/bug/person.go b/bug/person.go
index ff4d4a70..c79e9935 100644
--- a/bug/person.go
+++ b/bug/person.go
@@ -10,8 +10,9 @@ import (
)
type Person struct {
- Name string `json:"name"`
- Email string `json:"email"`
+ Name string `json:"name"`
+ Email string `json:"email"`
+ AvatarUrl string `json:"avatar_url"`
}
// GetUser will query the repository for user detail and build the corresponding Person
@@ -61,6 +62,10 @@ func (p Person) Validate() error {
return fmt.Errorf("email is not fully printable")
}
+ if p.AvatarUrl != "" && !text.ValidUrl(p.AvatarUrl) {
+ return fmt.Errorf("avatarUrl is not a valid URL")
+ }
+
return nil
}