@@ -482,16 +482,11 @@ func (r *Repository) ListTags(rbo *RepositoryTagOptions) (*RepositoryTags, error
482
482
}
483
483
484
484
urlStr := r .c .requestUrl ("/repositories/%s/%s/refs/tags?%s" , rbo .Owner , rbo .RepoSlug , params .Encode ())
485
- response , err := r .c .executeRaw ("GET" , urlStr , "" )
486
- if err != nil {
487
- return nil , err
488
- }
489
- bodyBytes , err := ioutil .ReadAll (response )
485
+ response , err := r .c .executePaginated ("GET" , urlStr , "" )
490
486
if err != nil {
491
487
return nil , err
492
488
}
493
- bodyString := string (bodyBytes )
494
- return decodeRepositoryTags (bodyString )
489
+ return decodeRepositoryTags (response )
495
490
}
496
491
497
492
func (r * Repository ) CreateTag (rbo * RepositoryTagCreationOptions ) (* RepositoryTag , error ) {
@@ -1202,19 +1197,13 @@ func decodeRepositoryTagCreated(tagResponseStr string) (*RepositoryTag, error) {
1202
1197
return & responseTagCreated , nil
1203
1198
}
1204
1199
1205
- func decodeRepositoryTags (tagResponseStr string ) (* RepositoryTags , error ) {
1206
-
1207
- var tagResponseMap map [string ]interface {}
1208
- err := json .Unmarshal ([]byte (tagResponseStr ), & tagResponseMap )
1209
- if err != nil {
1210
- return nil , err
1211
- }
1212
-
1200
+ func decodeRepositoryTags (tagResponse interface {}) (* RepositoryTags , error ) {
1201
+ tagResponseMap := tagResponse .(map [string ]interface {})
1213
1202
tagArray := tagResponseMap ["values" ].([]interface {})
1214
1203
var tags []RepositoryTag
1215
1204
for _ , tagEntry := range tagArray {
1216
1205
var tag RepositoryTag
1217
- err = mapstructure .Decode (tagEntry , & tag )
1206
+ err : = mapstructure .Decode (tagEntry , & tag )
1218
1207
if err == nil {
1219
1208
tags = append (tags , tag )
1220
1209
}
0 commit comments