Skip to content

Commit

Permalink
fix writing keys for new services:
Browse files Browse the repository at this point in the history
- This broke while I was refactoring the index handling code, some
  error checks were pasted out of order
  • Loading branch information
Daniel Fuentes committed Aug 2, 2018
1 parent b4edc16 commit 53ad806
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions store/s3store.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,6 @@ func (s *S3Store) readLatest(service string) (latest, error) {
}

resp, err := s.svc.GetObject(getObjectInput)
if err != nil {
return latest{}, err
}

raw, err := ioutil.ReadAll(resp.Body)
if err != nil {
return latest{}, err
}

if err != nil {
if aerr, ok := err.(awserr.Error); ok {
if aerr.Code() == s3.ErrCodeNoSuchKey {
Expand All @@ -385,6 +376,11 @@ func (s *S3Store) readLatest(service string) (latest, error) {
return latest{}, err
}

raw, err := ioutil.ReadAll(resp.Body)
if err != nil {
return latest{}, err
}

var index latest
if err := json.Unmarshal(raw, &index); err != nil {
return latest{}, err
Expand Down

0 comments on commit 53ad806

Please sign in to comment.