Skip to content

Commit 9e9d64b

Browse files
authored
tests/user_test: remove type assertion (#115)
Fixes "invalid type assertion: res.(map[string]<inter>) (non-interface type *bitbucket.User on left)". Signed-off-by: Kent R. Spillner <[email protected]>
1 parent f4f7472 commit 9e9d64b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/user_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ func TestProfile(t *testing.T) {
2222

2323
c := bitbucket.NewBasicAuth(user, pass)
2424

25-
res, _ := c.User.Profile()
26-
27-
jsonMap := res.(map[string]interface{})
25+
res, err := c.User.Profile()
26+
if err != nil {
27+
t.Error(err)
28+
}
2829

29-
if jsonMap["username"] != user {
30+
if res.Username != user {
3031
t.Error("Cannot catch the Profile.username.")
3132
}
3233
}

0 commit comments

Comments
 (0)