Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bhagya05 committed Apr 9, 2024
1 parent 1c3b6b1 commit eec2c44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions bindings/gcp/bucket/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ func (g *GCPStorage) sign(ctx context.Context, req *bindings.InvokeRequest) (*bi
signURL, err := g.signObject(metadata.Bucket, key, metadata.SignTTL)
if err != nil {
return nil, fmt.Errorf("gcp bucket binding error: %w", err)

}

jsonResponse, err := json.Marshal(signResponse{
Expand All @@ -377,11 +376,9 @@ func (g *GCPStorage) sign(ctx context.Context, req *bindings.InvokeRequest) (*bi
return &bindings.InvokeResponse{
Data: jsonResponse,
}, nil

}

func (g *GCPStorage) signObject(bucket, object, ttl string) (string, error) {

d, err := time.ParseDuration(ttl)
if err != nil {
return "", fmt.Errorf("gcp bucket binding error: error parsing signTTL: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions bindings/gcp/bucket/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestParseMetadata(t *testing.T) {
"projectID": "my_project_id",
"tokenURI": "my_token_uri",
"type": "my_type",
"signTTL": "15s",
"signTTL": "15s",
}
gs := GCPStorage{logger: logger.NewLogger("test")}
meta, err := gs.parseMetadata(m)
Expand All @@ -58,7 +58,7 @@ func TestParseMetadata(t *testing.T) {
assert.Equal(t, "my_project_id", meta.ProjectID)
assert.Equal(t, "my_token_uri", meta.TokenURI)
assert.Equal(t, "my_type", meta.Type)
assert.Equal(t,"15s",meta.SignTTL)
assert.Equal(t, "15s", meta.SignTTL)
})

t.Run("Metadata is correctly marshalled to JSON", func(t *testing.T) {
Expand Down

0 comments on commit eec2c44

Please sign in to comment.