diff --git a/internal/modules/trading/prices.go b/internal/modules/trading/prices.go index b1a1362..70de4d9 100644 --- a/internal/modules/trading/prices.go +++ b/internal/modules/trading/prices.go @@ -87,7 +87,7 @@ func (c *PriceClient) FetchPrice(ctx context.Context, ticker string) (float64, e if err != nil { return 0, fmt.Errorf("trading: KBS request: %w", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode < 200 || resp.StatusCode >= 300 { return 0, ErrNoPrice diff --git a/internal/storage/dynamodb_kv.go b/internal/storage/dynamodb_kv.go index 4e8b7a9..5bdc418 100644 --- a/internal/storage/dynamodb_kv.go +++ b/internal/storage/dynamodb_kv.go @@ -3,7 +3,6 @@ package storage import ( "context" "encoding/json" - "errors" "fmt" "strconv" "time" @@ -183,10 +182,3 @@ func (s *DynamoDBKVStore) List(ctx context.Context, prefix string) ([]string, er return keys, nil } -// errIsNotFound wraps the SDK NotFound condition. DynamoDB GetItem doesn't -// return an error for missing items (returns empty Item), but other ops may -// surface ResourceNotFoundException for missing tables. -func errIsTableMissing(err error) bool { - var rnfe *types.ResourceNotFoundException - return errors.As(err, &rnfe) -} diff --git a/template.yaml b/template.yaml index ca7d626..219bd4b 100644 --- a/template.yaml +++ b/template.yaml @@ -101,7 +101,6 @@ Resources: BotFunction: Type: AWS::Serverless::Function - DependsOn: BotFunctionLogGroup Properties: FunctionName: !Sub "${AWS::StackName}-bot" CodeUri: build/lambda/