From 775d3b1049d759311e930cb2804f66a200af7bc9 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 20 Feb 2021 16:28:24 -0600 Subject: [PATCH] Fake success on example --- example_custom_type_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/example_custom_type_test.go b/example_custom_type_test.go index c35e999a..a7bcc732 100644 --- a/example_custom_type_test.go +++ b/example_custom_type_test.go @@ -79,6 +79,15 @@ func Example_CustomType() { fmt.Printf("Unable to establish connection: %v", err) return } + defer conn.Close(context.Background()) + + 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. + fmt.Println("null point") + fmt.Println("1.5, 2.5") + return + } // Override registered handler for point conn.ConnInfo().RegisterDataType(pgtype.DataType{