From a13649549ac61a5e2f9b8f77865e3f8a574ffd03 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Thu, 19 Dec 2024 09:25:14 -0800 Subject: [PATCH] formatting --- testing/go/copy_test.go | 14 +++++++------- testing/go/framework.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testing/go/copy_test.go b/testing/go/copy_test.go index c1fab83779..b1532054d6 100755 --- a/testing/go/copy_test.go +++ b/testing/go/copy_test.go @@ -31,7 +31,7 @@ func TestCopy(t *testing.T) { }, Assertions: []ScriptTestAssertion{ { - Query: "COPY test_info FROM STDIN WITH (HEADER);", + Query: "COPY test_info FROM STDIN WITH (HEADER);", CopyFromStdInFile: "tab-load-with-header.sql", }, { @@ -56,7 +56,7 @@ func TestCopy(t *testing.T) { }, Assertions: []ScriptTestAssertion{ { - Query: "COPY regions (\"Id\", \"Code\", \"Capital\", \"Name\") FROM stdin;\n", + Query: "COPY regions (\"Id\", \"Code\", \"Capital\", \"Name\") FROM stdin;\n", CopyFromStdInFile: "tab-load-with-quoted-column-names.sql", }, }, @@ -68,7 +68,7 @@ func TestCopy(t *testing.T) { }, Assertions: []ScriptTestAssertion{ { - Query: "COPY tbl1 FROM STDIN (FORMAT CSV)", + Query: "COPY tbl1 FROM STDIN (FORMAT CSV)", CopyFromStdInFile: "csv-load-basic-cases.sql", }, { @@ -94,7 +94,7 @@ bar`, "baz"}, }, Assertions: []ScriptTestAssertion{ { - Query: " COPY tbl1 FROM STDIN (FORMAT CSV, HEADER TRUE);", + Query: " COPY tbl1 FROM STDIN (FORMAT CSV, HEADER TRUE);", CopyFromStdInFile: "csv-load-with-header.sql", }, { @@ -114,7 +114,7 @@ bar`, "baz"}, }, Assertions: []ScriptTestAssertion{ { - Query: "COPY tbl1 FROM STDIN (FORMAT CSV);", + Query: "COPY tbl1 FROM STDIN (FORMAT CSV);", CopyFromStdInFile: "csv-load-multi-chunk.sql", }, { @@ -134,7 +134,7 @@ bar`, "baz"}, }, Assertions: []ScriptTestAssertion{ { - Query: "COPY test_info FROM STDIN (FORMAT CSV, HEADER TRUE, DELIMITER '|');", + Query: "COPY test_info FROM STDIN (FORMAT CSV, HEADER TRUE, DELIMITER '|');", CopyFromStdInFile: "psv-load.sql", }, { @@ -148,4 +148,4 @@ bar`, "baz"}, }, }, }) -} \ No newline at end of file +} diff --git a/testing/go/framework.go b/testing/go/framework.go index 7d363567a4..a31c2728f3 100644 --- a/testing/go/framework.go +++ b/testing/go/framework.go @@ -106,7 +106,7 @@ type ScriptTestAssertion struct { // Cols is used to check the column names returned from the server. Cols []string - + // CopyFromSTDIN is used to test the COPY FROM STDIN command. CopyFromStdInFile string } @@ -235,7 +235,7 @@ func copyFromStdin(t *testing.T, conn *pgx.Conn, query string, filename string) t.Fatalf("Failed to open file: %v", err) } defer file.Close() - + reader := bufio.NewReader(file) _, err = conn.PgConn().CopyFrom(context.Background(), reader, query) require.NoError(t, err)