Skip to content

Commit

Permalink
Fix a few minor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
foxcpp committed Sep 22, 2021
1 parent 31265e3 commit a1fc99d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ linters:
- whitespace
- nakedret
- dogsled
- scopelint
- exportloopref
1 change: 0 additions & 1 deletion framework/config/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (e Endpoint) Address() string {
return e.Path
}
return net.JoinHostPort(e.Host, e.Port)

}

func (e Endpoint) IsTLS() bool {
Expand Down
8 changes: 6 additions & 2 deletions internal/storage/blob/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ func (b *s3blob) Write(p []byte) (n int, err error) {

func (b *s3blob) Close() error {
if !b.didSync {
b.pw.CloseWithError(fmt.Errorf("storage.blob.s3: blob closed without Sync"))
if err := b.pw.CloseWithError(fmt.Errorf("storage.blob.s3: blob closed without Sync")); err != nil {
panic(err)
}
}
return nil
}
Expand All @@ -127,7 +129,9 @@ func (s *Store) Create(ctx context.Context, key string, blobSize int64) (module.
PartSize: partSize,
})
if err != nil {
pr.CloseWithError(fmt.Errorf("s3 PutObject: %w", err))
if err := pr.CloseWithError(fmt.Errorf("s3 PutObject: %w", err)); err != nil {
panic(err)
}
}
errCh <- err
}()
Expand Down
4 changes: 3 additions & 1 deletion internal/storage/blob/test_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ func TestStore(t *testing.T, newStore func() module.BlobStore, cleanStore func(m
}
cleanBackend := func(bi backendtests.Backend) {
b := bi.(testBack)
b.Backend.(*imapsql.Backend).Close()
if err := b.Backend.(*imapsql.Backend).Close(); err != nil {
panic(err)
}
cleanStore(b.ExtStore)
}

Expand Down

0 comments on commit a1fc99d

Please sign in to comment.