File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ require (
77 github.com/bsm/gomega v1.27.10
88 github.com/cespare/xxhash/v2 v2.2.0
99 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
10+ github.com/google/uuid v1.6.0
1011)
1112
1213retract (
Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj
66github.com/cespare/xxhash/v2 v2.2.0 /go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs =
77github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78 =
88github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f /go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc =
9+ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0 =
10+ github.com/google/uuid v1.6.0 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
Original file line number Diff line number Diff line change 88
99 . "github.com/bsm/ginkgo/v2"
1010 . "github.com/bsm/gomega"
11-
11+ "github.com/google/uuid"
1212 "github.com/redis/go-redis/v9/internal/util"
1313)
1414
@@ -48,6 +48,10 @@ type TimeData struct {
4848 Time * TimeRFC3339Nano `redis:"login"`
4949}
5050
51+ type UUIDData struct {
52+ ID uuid.UUID `redis:"id"`
53+ }
54+
5155type i []interface {}
5256
5357func TestGinkgoSuite (t * testing.T ) {
@@ -217,4 +221,13 @@ var _ = Describe("Scan", func() {
217221 Expect (Scan (& tt , i {"time" }, i {now .Format (time .RFC3339Nano )})).NotTo (HaveOccurred ())
218222 Expect (now .Unix ()).To (Equal (tt .Time .Unix ()))
219223 })
224+
225+ It ("should unmarshal UUID" , func () {
226+ var ud UUIDData
227+
228+ testUUID := uuid .New ()
229+
230+ Expect (Scan (& ud , i {"id" }, i {testUUID .String ()})).NotTo (HaveOccurred ())
231+ Expect (ud .ID ).To (Equal (testUUID ))
232+ })
220233})
You can’t perform that action at this time.
0 commit comments