Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Lettieri <[email protected]>
  • Loading branch information
RyanLettieri committed Jul 12, 2022
1 parent 5794847 commit b07c8f5
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions bindings/azure/cosmosdb/cosmosdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ type cosmosDBCredentials struct {
PartitionKey string `json:"partitionKey"`
}

const statusTooManyRequests = "429" // RFC 6585, 4

// NewCosmosDB returns a new CosmosDB instance.
func NewCosmosDB(logger logger.Logger) *CosmosDB {
return &CosmosDB{logger: logger}
Expand Down Expand Up @@ -73,25 +71,25 @@ func (c *CosmosDB) Init(metadata bindings.Metadata) error {
}
} else {
// Fallback to using Azure AD
env, errB := azure.NewEnvironmentSettings("cosmosdb", metadata.Properties)
if errB != nil {
return errB
env, errEnv := azure.NewEnvironmentSettings("cosmosdb", metadata.Properties)
if errEnv != nil {
return errEnv
}
token, err := env.GetTokenCredential()
if err != nil {
return err
token, errToken := env.GetTokenCredential()
if errToken != nil {
return errToken
}
client, err = azcosmos.NewClient(m.URL, token, nil)
if err != nil {
return err
}
}
// Create a container client

dbClient, err := client.NewDatabase(m.Database)
if err != nil {
return err
}

// Create a container client
dbContainer, err := dbClient.NewContainer(m.Collection)
if err != nil {
return err
Expand Down Expand Up @@ -135,7 +133,7 @@ func (c *CosmosDB) Operations() []bindings.OperationKind {
return []bindings.OperationKind{bindings.CreateOperation}
}

func (c *CosmosDB) Invoke(_ context.Context, req *bindings.InvokeRequest) (*bindings.InvokeResponse, error) {
func (c *CosmosDB) Invoke(ctx context.Context, req *bindings.InvokeRequest) (*bindings.InvokeResponse, error) {
switch req.Operation {
case bindings.CreateOperation:
var obj interface{}
Expand Down

0 comments on commit b07c8f5

Please sign in to comment.