1
0
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:
sam-ke
2019-04-10 15:27:06 +03:00
committed by Vladimir Mihailenco
parent 2f1ad94a2a
commit 94ec556725
2 changed files with 40 additions and 0 deletions

View File

@ -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))
})
})