Skip to content

Commit f8435c9

Browse files
committed
fix: linting errors
1 parent 1c94fc7 commit f8435c9

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

aws/sqs/sqs_integration_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func setup() {
3838
}
3939

4040
func teardown() {
41-
if err := exec.Command(
41+
if err := exec.Command( //nolint:gosec
4242
"aws", "sqs",
4343
"delete-queue",
4444
"--queue-url", awsCmdQueueURL(),
@@ -75,13 +75,13 @@ func awsCmdQueueURL() string {
7575
panic(err)
7676
} else {
7777
var payload map[string]string
78-
json.Unmarshal(out, &payload)
78+
_ = json.Unmarshal(out, &payload)
7979
return payload["QueueUrl"]
8080
}
8181
}
8282

8383
func awsCmdSendMessage() {
84-
if err := exec.Command(
84+
if err := exec.Command( //nolint:gosec
8585
"aws", "sqs",
8686
"send-message",
8787
"--queue-url", awsCmdQueueURL(),
@@ -94,7 +94,7 @@ func awsCmdSendMessage() {
9494
}
9595

9696
func awsCmdReceiveMessage() string {
97-
if out, err := exec.Command(
97+
if out, err := exec.Command( //nolint:gosec
9898
"aws", "sqs",
9999
"receive-message",
100100
"--queue-url", awsCmdQueueURL(),
@@ -105,13 +105,13 @@ func awsCmdReceiveMessage() string {
105105
panic(err)
106106
} else {
107107
var payload map[string][]map[string]string
108-
json.Unmarshal(out, &payload)
108+
_ = json.Unmarshal(out, &payload)
109109
return payload["Messages"][0]["Body"]
110110
}
111111
}
112112

113113
func awsCmdReceiveMessages() []string {
114-
if out, err := exec.Command(
114+
if out, err := exec.Command( //nolint:gosec
115115
"aws", "sqs",
116116
"receive-message",
117117
"--queue-url", awsCmdQueueURL(),
@@ -123,7 +123,7 @@ func awsCmdReceiveMessages() []string {
123123
panic(err)
124124
} else {
125125
var payload map[string][]map[string]string
126-
json.Unmarshal(out, &payload)
126+
_ = json.Unmarshal(out, &payload)
127127

128128
var bodies []string
129129
for _, msg := range payload["Messages"] {
@@ -136,7 +136,7 @@ func awsCmdReceiveMessages() []string {
136136
}
137137

138138
func awsCmdQueueCount() int {
139-
if out, err := exec.Command(
139+
if out, err := exec.Command( //nolint:gosec
140140
"aws", "sqs",
141141
"get-queue-attributes",
142142
"--queue-url", awsCmdQueueURL(),
@@ -146,14 +146,14 @@ func awsCmdQueueCount() int {
146146
panic(err)
147147
} else {
148148
var payload map[string]map[string]string
149-
json.Unmarshal(out, &payload)
149+
_ = json.Unmarshal(out, &payload)
150150
rvalue, _ := strconv.Atoi(payload["Attributes"]["ApproximateNumberOfMessages"])
151151
return rvalue
152152
}
153153
}
154154

155155
func awsCmdQueueInFlightCount() int {
156-
out, err := exec.Command(
156+
out, err := exec.Command( //nolint:gosec
157157
"aws", "sqs",
158158
"get-queue-attributes",
159159
"--queue-url", awsCmdQueueURL(),
@@ -165,7 +165,7 @@ func awsCmdQueueInFlightCount() int {
165165
}
166166

167167
var payload map[string]map[string]string
168-
json.Unmarshal(out, &payload)
168+
_ = json.Unmarshal(out, &payload)
169169

170170
rvalue, _ := strconv.Atoi(payload["Attributes"]["ApproximateNumberOfMessagesNotVisible"])
171171
return rvalue
@@ -541,7 +541,7 @@ func TestSendBatch(t *testing.T) {
541541
// ACTION
542542
var maxBytes int = 262144
543543
maxSizeSingleMessage := ""
544-
for _ = range maxBytes {
544+
for range maxBytes {
545545
maxSizeSingleMessage += "a"
546546
}
547547
err = client.SendBatch(context.TODO(), awsCmdQueueURL(), []string{maxSizeSingleMessage})
@@ -560,7 +560,7 @@ func TestSendBatch(t *testing.T) {
560560
// ACTION
561561
var maxHalfBytes int = 131072
562562
maxHalfSizeMessage := ""
563-
for _ = range maxHalfBytes {
563+
for range maxHalfBytes {
564564
maxHalfSizeMessage += "a"
565565
}
566566
err = client.SendBatch(context.TODO(), awsCmdQueueURL(), []string{maxHalfSizeMessage, maxHalfSizeMessage})
@@ -614,7 +614,7 @@ func TestSendNBatch(t *testing.T) {
614614
// ACTION
615615
var maxBytes int = 262144
616616
maxSizeSingleMessage := ""
617-
for _ = range maxBytes {
617+
for range maxBytes {
618618
maxSizeSingleMessage += "a"
619619
}
620620
batchesSent, err := client.SendNBatch(context.TODO(), awsCmdQueueURL(), []string{maxSizeSingleMessage, maxSizeSingleMessage})
@@ -659,7 +659,7 @@ func TestSendNBatch(t *testing.T) {
659659
assert.Equal(t, 3, batchesSent)
660660

661661
receiveCount := 0
662-
for _ = range 3 {
662+
for range batchesSent {
663663
messages := awsCmdReceiveMessages()
664664
for _, m := range messages {
665665
if m == smallMessageText {

0 commit comments

Comments
 (0)