mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Add Float32 helper
This commit is contained in:
committed by
Vladimir Mihailenco
parent
2f1ad94a2a
commit
94ec556725
@ -57,4 +57,14 @@ var _ = Describe("Cmd", func() {
|
||||
Expect(f).To(Equal(float64(10)))
|
||||
})
|
||||
|
||||
It("supports float32", func() {
|
||||
f := float32(66.97)
|
||||
|
||||
err := client.Set("float_key", f, 0).Err()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
val, err := client.Get("float_key").Float32()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(val).To(Equal(f))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user