From 7b40032fcde5f9074d15731fdd2bf69a22123efe Mon Sep 17 00:00:00 2001 From: Charlie Vieth Date: Mon, 23 Jan 2023 13:38:58 -0500 Subject: [PATCH] sql: assert UUID satisfies the driver.Valuer and sql.Scanner interfaces (#113) --- sql.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql.go b/sql.go index 94021b9..01d5d88 100644 --- a/sql.go +++ b/sql.go @@ -22,10 +22,14 @@ package uuid import ( + "database/sql" "database/sql/driver" "fmt" ) +var _ driver.Valuer = UUID{} +var _ sql.Scanner = (*UUID)(nil) + // Value implements the driver.Valuer interface. func (u UUID) Value() (driver.Value, error) { return u.String(), nil