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{