Skip to content

Commit b189c45

Browse files
author
chhsia0
committed
Made Bitbucket's struct commonly shared with multiple services.
1 parent 399a8d5 commit b189c45

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

scm/driver/bitbucket/bitbucket.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ type pagination struct {
115115
Next string `json:"next"`
116116
}
117117

118+
// link represents Bitbucket link properties embedded in responses.
119+
type link struct {
120+
Href string `json:"href"`
121+
}
122+
118123
// Error represents a Bitbucket error.
119124
type Error struct {
120125
Type string `json:"type"`

scm/driver/bitbucket/user.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,10 @@ func (s *userService) FindEmail(ctx context.Context) (string, *scm.Response, err
3535
type user struct {
3636
Login string `json:"username"`
3737
Name string `json:"display_name"`
38-
Links links `json:"links"`
39-
}
40-
41-
type links struct {
42-
HTML link `json:"html"`
43-
Avatar link `json:"avatar"`
44-
}
45-
46-
type link struct {
47-
Href string `json:"href"`
38+
Links struct {
39+
HTML link `json:"html"`
40+
Avatar link `json:"avatar"`
41+
} `json:"links"`
4842
}
4943

5044
func convertUser(from *user) *scm.User {

0 commit comments

Comments
 (0)