Skip to content

Commit

Permalink
Fix ListTags (#94) (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanM93 authored Aug 6, 2020
1 parent fdf03c4 commit 34d2968
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,12 @@ func (r *Repository) ListTags(rbo *RepositoryTagOptions) (*RepositoryTags, error
if err != nil {
return nil, err
}

return decodeRepositoryTags(response)
bodyBytes, err := ioutil.ReadAll(response)
if err != nil {
return nil, err
}
bodyString := string(bodyBytes)
return decodeRepositoryTags(bodyString)
}

func (r *Repository) Delete(ro *RepositoryOptions) (interface{}, error) {
Expand Down Expand Up @@ -575,10 +579,10 @@ func decodeRepositoryBranch(branchResponseStr string) (*RepositoryBranch, error)
return &repositoryBranch, nil
}

func decodeRepositoryTags(tagResponse interface{}) (*RepositoryTags, error) {
func decodeRepositoryTags(tagResponseStr string) (*RepositoryTags, error) {

var tagResponseMap map[string]interface{}
err := json.Unmarshal(tagResponse.([]byte), &tagResponseMap)
err := json.Unmarshal([]byte(tagResponseStr), &tagResponseMap)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 34d2968

Please sign in to comment.