Skip to content

Commit a9b50b5

Browse files
fix: lint
1 parent 377a6e3 commit a9b50b5

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

flow/connectors/postgres/pgdump_schema_test.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ func TestRunPipeline_LargeStream(t *testing.T) {
188188
ctx := t.Context()
189189

190190
const size = 2 * 1024 * 1024 // 2 MiB
191-
src := exec.CommandContext(ctx, "sh", "-c", "yes a | head -c "+itoa(size))
191+
// #nosec G204 -- test-only, constant arguments
192+
src := exec.CommandContext(ctx, "sh", "-c", "yes a | head -c 2097152")
192193
var out bytes.Buffer
193194
dst := exec.CommandContext(ctx, "cat")
194195
dst.Stdout = &out
@@ -238,18 +239,3 @@ func TestRunPipeline_ContextCancel(t *testing.T) {
238239
t.Fatal("runPipeline did not return after context cancel")
239240
}
240241
}
241-
242-
// itoa avoids importing strconv just for one call site in tests.
243-
func itoa(n int) string {
244-
if n == 0 {
245-
return "0"
246-
}
247-
var buf [20]byte
248-
i := len(buf)
249-
for n > 0 {
250-
i--
251-
buf[i] = byte('0' + n%10)
252-
n /= 10
253-
}
254-
return string(buf[i:])
255-
}

0 commit comments

Comments
 (0)