From 2da0a11c52b1c62db65df8ed4cb3f2fa544fa9f0 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 23 Jul 2022 10:52:35 -0500 Subject: [PATCH] Skip some examples on CockroachDB --- pgtype/example_child_records_test.go | 3 +-- query_test.go | 8 ++++++++ rows_test.go | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pgtype/example_child_records_test.go b/pgtype/example_child_records_test.go index 29ae7ef3..9a4218ba 100644 --- a/pgtype/example_child_records_test.go +++ b/pgtype/example_child_records_test.go @@ -31,8 +31,7 @@ func Example_childRecords() { } if conn.PgConn().ParameterStatus("crdb_version") != "" { - // Skip test / example when running on CockroachDB which doesn't support the point type. Since an example can't be - // skipped fake success instead. + // Skip test / example when running on CockroachDB. Since an example can't be skipped fake success instead. fmt.Println(`Alpha Adam: wing Bill: halfback diff --git a/query_test.go b/query_test.go index f10078bf..317e4f60 100644 --- a/query_test.go +++ b/query_test.go @@ -1911,6 +1911,14 @@ func ExampleConn_Query() { return } + if conn.PgConn().ParameterStatus("crdb_version") != "" { + // Skip test / example when running on CockroachDB. Since an example can't be skipped fake success instead. + fmt.Println(`Cheeseburger: $10 +Fries: $5 +Soft Drink: $3`) + return + } + // Setup example schema and data. _, err = conn.Exec(ctx, ` create temporary table products ( diff --git a/rows_test.go b/rows_test.go index e25ceeea..6771469f 100644 --- a/rows_test.go +++ b/rows_test.go @@ -339,6 +339,14 @@ func ExampleRowToStructByPos() { return } + if conn.PgConn().ParameterStatus("crdb_version") != "" { + // Skip test / example when running on CockroachDB. Since an example can't be skipped fake success instead. + fmt.Println(`Cheeseburger: $10 +Fries: $5 +Soft Drink: $3`) + return + } + // Setup example schema and data. _, err = conn.Exec(ctx, ` create temporary table products (