mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-09-02 18:20:04 +00:00
fix(ci): clear sam lint + golangci-lint findings
- template.yaml: drop redundant DependsOn (W3005) — Ref in LoggingConfig already implies BotFunctionLogGroup ordering. - dynamodb_kv.go: remove unused errIsTableMissing and orphaned errors import. - trading/prices.go: wrap deferred resp.Body.Close to satisfy errcheck.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -101,7 +101,6 @@ Resources:
|
||||
|
||||
BotFunction:
|
||||
Type: AWS::Serverless::Function
|
||||
DependsOn: BotFunctionLogGroup
|
||||
Properties:
|
||||
FunctionName: !Sub "${AWS::StackName}-bot"
|
||||
CodeUri: build/lambda/
|
||||
|
||||
Reference in New Issue
Block a user