Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Commit 557cfc0

Browse files
committed
Fix linter
1 parent 999087e commit 557cfc0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

internal/alert/manager.go

-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ func (am *alertManager) HandleAlert(alert core.Alert, policy *core.AlertPolicy)
227227
if err := am.handleSNSPublish(alert, policy); err != nil {
228228
am.logger.Error("could not publish to sns", zap.Error(err))
229229
}
230-
231230
}
232231

233232
// Shutdown ... Shuts down the alert manager subsystem

internal/client/sns.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ package client
44

55
import (
66
"context"
7+
"os"
8+
79
"github.com/aws/aws-sdk-go/aws"
810
"github.com/aws/aws-sdk-go/aws/session"
911
"github.com/aws/aws-sdk-go/service/sns"
1012
"github.com/base-org/pessimism/internal/core"
1113
"github.com/base-org/pessimism/internal/logging"
14+
1215
"go.uber.org/zap"
13-
"os"
1416
)
1517

1618
// SNSClient ... An interface for SNS clients to implement
@@ -31,14 +33,15 @@ type snsClient struct {
3133

3234
// NewSNSClient ... Initializer
3335
func NewSNSClient(cfg *SNSConfig, name string) SNSClient {
34-
3536
if cfg.TopicArn == "" {
3637
logging.NoContext().Warn("No SNS topic ARN provided")
3738
}
3839

3940
logging.NoContext().Debug("AWS Region", zap.String("region", os.Getenv("AWS_REGION")))
4041

41-
// Initialize a session that the SDK will use
42+
// Initialize a session that the SDK will use to load configuration,
43+
// credentials, and region. AWS_REGION, AWS_SECRET_ACCESS_KEY, and AWS_ACCESS_KEY_ID should be set in the
44+
// environment's runtime
4245
sess, err := session.NewSession()
4346
if err != nil {
4447
logging.NoContext().Error("Failed to create SNS session", zap.Error(err))
@@ -53,7 +56,7 @@ func NewSNSClient(cfg *SNSConfig, name string) SNSClient {
5356
}
5457

5558
// PostEvent ... Posts an event to an SNS topic ARN
56-
func (sc snsClient) PostEvent(ctx context.Context, event *AlertEventTrigger) (*AlertAPIResponse, error) {
59+
func (sc snsClient) PostEvent(_ context.Context, event *AlertEventTrigger) (*AlertAPIResponse, error) {
5760
// Publish a message to the topic
5861
result, err := sc.svc.Publish(&sns.PublishInput{
5962
MessageAttributes: getAttributesFromEvent(event),

0 commit comments

Comments
 (0)