Fix ineffectual assignments

- Don't assign variables we don't end up using
- Added missing error check in test
This commit is contained in:
Christian Muehlhaeuser 2019-08-08 09:21:21 +00:00 committed by mattn
parent 1ccf66b8b4
commit 1b7f743892
4 changed files with 14 additions and 11 deletions

View file

@ -609,6 +609,9 @@ func TestUploadMedia(t *testing.T) {
t.Fatalf("want %q but %q", "123", attachment.ID)
}
file, err := os.Open("testdata/logo.png")
if err != nil {
t.Fatalf("could not open file: %v", err)
}
defer file.Close()
writerAttachment, err := client.UploadMediaFromReader(context.Background(), file)
if err != nil {