Commit de72ae7 1 parent d31c991 commit de72ae7 Copy full SHA for de72ae7
File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ require (
7
7
github.com/bsm/gomega v1.27.10
8
8
github.com/cespare/xxhash/v2 v2.2.0
9
9
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
10
+ github.com/google/uuid v1.6.0
10
11
)
11
12
12
13
retract (
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
6
6
github.com/cespare/xxhash/v2 v2.2.0 /go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs =
7
7
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78 =
8
8
github.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 8
8
9
9
. "github.com/bsm/ginkgo/v2"
10
10
. "github.com/bsm/gomega"
11
-
11
+ "github.com/google/uuid"
12
12
"github.com/redis/go-redis/v9/internal/util"
13
13
)
14
14
@@ -48,6 +48,10 @@ type TimeData struct {
48
48
Time * TimeRFC3339Nano `redis:"login"`
49
49
}
50
50
51
+ type UUIDData struct {
52
+ ID uuid.UUID `redis:"id"`
53
+ }
54
+
51
55
type i []interface {}
52
56
53
57
func TestGinkgoSuite (t * testing.T ) {
@@ -217,4 +221,13 @@ var _ = Describe("Scan", func() {
217
221
Expect (Scan (& tt , i {"time" }, i {now .Format (time .RFC3339Nano )})).NotTo (HaveOccurred ())
218
222
Expect (now .Unix ()).To (Equal (tt .Time .Unix ()))
219
223
})
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
+ })
220
233
})
You can’t perform that action at this time.
0 commit comments