Skip to content

Commit

Permalink
cleaned up error handling per code review suggestions. go-spatial#211
Browse files Browse the repository at this point in the history
  • Loading branch information
ARolek committed Dec 9, 2017
1 parent 1bf45d5 commit 8224b0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
12 changes: 0 additions & 12 deletions cache/s3cache/s3cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ func (s3c *S3Cache) Set(key *cache.Key, val []byte) error {

_, err = s3c.Client.PutObject(&input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
default:
return aerr
}
}
return err
}

Expand Down Expand Up @@ -229,12 +223,6 @@ func (s3c *S3Cache) Purge(key *cache.Key) error {

_, err = s3c.Client.DeleteObject(&input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
default:
return err
}
}
return err
}

Expand Down
8 changes: 4 additions & 4 deletions cache/s3cache/s3cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestSetGetPurge(t *testing.T) {
X: 1,
Y: 2,
},
expected: []byte("\x53\x69\x6c\x61\x73"),
expected: []byte{0x53, 0x69, 0x6c, 0x61, 0x73},
},
}

Expand Down Expand Up @@ -152,9 +152,9 @@ func TestSetOverwrite(t *testing.T) {
X: 1,
Y: 1,
},
bytes1: []byte("\x66\x6f\x6f"),
bytes2: []byte("\x53\x69\x6c\x61\x73"),
expected: []byte("\x53\x69\x6c\x61\x73"),
bytes1: []byte{0x66, 0x6f, 0x6f},
bytes2: []byte{0x53, 0x69, 0x6c, 0x61, 0x73},
expected: []byte{0x53, 0x69, 0x6c, 0x61, 0x73},
},
}

Expand Down

0 comments on commit 8224b0c

Please sign in to comment.