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:
2026-05-14 09:57:12 +07:00
parent f3b9891a54
commit 9c9bc65db8
3 changed files with 1 additions and 10 deletions
+1 -1
View File
@@ -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
-8
View File
@@ -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)
}
-1
View File
@@ -101,7 +101,6 @@ Resources:
BotFunction:
Type: AWS::Serverless::Function
DependsOn: BotFunctionLogGroup
Properties:
FunctionName: !Sub "${AWS::StackName}-bot"
CodeUri: build/lambda/