Skip to content

Commit

Permalink
format: gofumt
Browse files Browse the repository at this point in the history
Signed-off-by: sadath-12 <[email protected]>
  • Loading branch information
sadath-12 committed Nov 11, 2023
1 parent 13779ba commit fee4335
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion bindings/azure/blobstorage/blobstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func (a *AzureBlobStorage) get(ctx context.Context, req *bindings.InvokeRequest)
}

blobDownloadResponse, err := blockBlobClient.DownloadStream(ctx, &downloadOptions)

if err != nil {
if bloberror.HasCode(err, bloberror.BlobNotFound) {
return nil, fmt.Errorf("blob not found")
Expand Down
13 changes: 8 additions & 5 deletions bindings/gcp/bucket/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ import (
"context"
b64 "encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"reflect"
"strconv"
"errors"
"net/http"


"cloud.google.com/go/storage"
"github.com/google/uuid"
"google.golang.org/api/googleapi"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/googleapi"


"github.com/dapr/components-contrib/bindings"
"github.com/dapr/components-contrib/metadata"
Expand Down Expand Up @@ -255,6 +253,11 @@ func (g *GCPStorage) delete(ctx context.Context, req *bindings.InvokeRequest) (*

err := object.Delete(ctx)

var apiErr *googleapi.Error
if errors.As(err, &apiErr) && apiErr.Code == http.StatusNotFound {
return nil, errors.New("object not found")
}

return nil, err
}

Expand Down
6 changes: 5 additions & 1 deletion bindings/huawei/obs/obs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"errors"
"fmt"
"io"
"net/http"
"reflect"
"strconv"
"net/http"

"github.com/google/uuid"
"github.com/huaweicloud/huaweicloud-sdk-go-obs/obs"
Expand Down Expand Up @@ -261,6 +261,10 @@ func (o *HuaweiOBS) delete(ctx context.Context, req *bindings.InvokeRequest) (*b

out, err := o.service.DeleteObject(ctx, input)
if err != nil {
var obsErr obs.ObsError
if errors.As(err, &obsErr) && obsErr.StatusCode == http.StatusNotFound {
return nil, errors.New("object not found")
}
return nil, fmt.Errorf("obs binding error. error deleting obs object: %w", err)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
)

const (
sidecarName = "blobstorage-sidecar"
sidecarName = "blobstorage-sidecar"
blobNotFound = "blob not found"
)

Expand Down

0 comments on commit fee4335

Please sign in to comment.