Skip to content

Commit b846cfc

Browse files
Merge branch 'master' into DOC-5229-prob-dt-examples
2 parents 67c62f6 + 7d97cc1 commit b846cfc

File tree

32 files changed

+257
-162
lines changed

32 files changed

+257
-162
lines changed

.github/actions/run-tests/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ runs:
2525
2626
# Mapping of redis version to redis testing containers
2727
declare -A redis_version_mapping=(
28-
["8.0.1"]="8.0.1-pre"
29-
["7.4.2"]="rs-7.4.0-v2"
30-
["7.2.7"]="rs-7.2.0-v14"
28+
["8.0.x"]="8.0.2"
29+
["7.4.x"]="rs-7.4.0-v5"
30+
["7.2.x"]="rs-7.2.0-v17"
3131
)
3232
3333
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
redis-version:
21-
- "8.0.1" # 8.0.1
22-
- "7.4.2" # should use redis stack 7.4
21+
- "8.0.x" # Redis CE 8.0
22+
- "7.4.x" # Redis stack 7.4
2323
go-version:
2424
- "1.23.x"
2525
- "1.24.x"
@@ -43,8 +43,8 @@ jobs:
4343
4444
# Mapping of redis version to redis testing containers
4545
declare -A redis_version_mapping=(
46-
["8.0.1"]="8.0.1-pre"
47-
["7.4.2"]="rs-7.4.0-v2"
46+
["8.0.x"]="8.0.2"
47+
["7.4.x"]="rs-7.4.0-v5"
4848
)
4949
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
5050
echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
@@ -72,9 +72,9 @@ jobs:
7272
fail-fast: false
7373
matrix:
7474
redis-version:
75-
- "8.0.1" # 8.0.1
76-
- "7.4.2" # should use redis stack 7.4
77-
- "7.2.7" # should redis stack 7.2
75+
- "8.0.x" # Redis CE 8.0
76+
- "7.4.x" # Redis stack 7.4
77+
- "7.2.x" # Redis stack 7.2
7878
go-version:
7979
- "1.23.x"
8080
- "1.24.x"

.github/workflows/doctests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
services:
1818
redis-stack:
19-
image: redislabs/client-libs-test:8.0.1-pre
19+
image: redislabs/client-libs-test:8.0.2
2020
env:
2121
TLS_ENABLED: no
2222
REDIS_CLUSTER: no

RELEASE-NOTES.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Release Notes
22

3+
# 9.10.0 (2025-06-06)
4+
5+
## 🚀 Highlights
6+
7+
`go-redis` now supports [vector sets](https://redis.io/docs/latest/develop/data-types/vector-sets/). This data type is marked
8+
as "in preview" in Redis and its support in `go-redis` is marked as experimental. You can find examples in the documentation and
9+
in the `doctests` folder.
10+
11+
# Changes
12+
13+
## 🚀 New Features
14+
15+
- feat: support vectorset ([#3375](https://github.com/redis/go-redis/pull/3375))
16+
17+
## 🧰 Maintenance
18+
19+
- Add the missing NewFloatSliceResult for testing ([#3393](https://github.com/redis/go-redis/pull/3393))
20+
- DOC-5078 vector set examples ([#3394](https://github.com/redis/go-redis/pull/3394))
21+
22+
## Contributors
23+
We'd like to thank all the contributors who worked on this release!
24+
25+
[@AndBobsYourUncle](https://github.com/AndBobsYourUncle), [@andy-stark-redis](https://github.com/andy-stark-redis), [@fukua95](https://github.com/fukua95) and [@ndyakov](https://github.com/ndyakov)
26+
27+
28+
329
# 9.9.0 (2025-05-27)
430

531
## 🚀 Highlights

auth/auth_test.go

Lines changed: 84 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package auth
22

33
import (
44
"errors"
5+
"strings"
56
"sync"
67
"testing"
78
"time"
@@ -179,36 +180,90 @@ func TestStreamingCredentialsProvider(t *testing.T) {
179180
}
180181

181182
func TestBasicCredentials(t *testing.T) {
182-
t.Run("basic auth", func(t *testing.T) {
183-
creds := NewBasicCredentials("user1", "pass1")
184-
username, password := creds.BasicAuth()
185-
if username != "user1" {
186-
t.Fatalf("expected username 'user1', got '%s'", username)
187-
}
188-
if password != "pass1" {
189-
t.Fatalf("expected password 'pass1', got '%s'", password)
190-
}
191-
})
192-
193-
t.Run("raw credentials", func(t *testing.T) {
194-
creds := NewBasicCredentials("user1", "pass1")
195-
raw := creds.RawCredentials()
196-
expected := "user1:pass1"
197-
if raw != expected {
198-
t.Fatalf("expected raw credentials '%s', got '%s'", expected, raw)
199-
}
200-
})
183+
tests := []struct {
184+
name string
185+
username string
186+
password string
187+
expectedUser string
188+
expectedPass string
189+
expectedRaw string
190+
}{
191+
{
192+
name: "basic auth",
193+
username: "user1",
194+
password: "pass1",
195+
expectedUser: "user1",
196+
expectedPass: "pass1",
197+
expectedRaw: "user1:pass1",
198+
},
199+
{
200+
name: "empty username",
201+
username: "",
202+
password: "pass1",
203+
expectedUser: "",
204+
expectedPass: "pass1",
205+
expectedRaw: ":pass1",
206+
},
207+
{
208+
name: "empty password",
209+
username: "user1",
210+
password: "",
211+
expectedUser: "user1",
212+
expectedPass: "",
213+
expectedRaw: "user1:",
214+
},
215+
{
216+
name: "both username and password empty",
217+
username: "",
218+
password: "",
219+
expectedUser: "",
220+
expectedPass: "",
221+
expectedRaw: ":",
222+
},
223+
{
224+
name: "special characters",
225+
username: "user:1",
226+
password: "pa:ss@!#",
227+
expectedUser: "user:1",
228+
expectedPass: "pa:ss@!#",
229+
expectedRaw: "user:1:pa:ss@!#",
230+
},
231+
{
232+
name: "unicode characters",
233+
username: "ユーザー",
234+
password: "密碼123",
235+
expectedUser: "ユーザー",
236+
expectedPass: "密碼123",
237+
expectedRaw: "ユーザー:密碼123",
238+
},
239+
{
240+
name: "long credentials",
241+
username: strings.Repeat("u", 1000),
242+
password: strings.Repeat("p", 1000),
243+
expectedUser: strings.Repeat("u", 1000),
244+
expectedPass: strings.Repeat("p", 1000),
245+
expectedRaw: strings.Repeat("u", 1000) + ":" + strings.Repeat("p", 1000),
246+
},
247+
}
201248

202-
t.Run("empty username", func(t *testing.T) {
203-
creds := NewBasicCredentials("", "pass1")
204-
username, password := creds.BasicAuth()
205-
if username != "" {
206-
t.Fatalf("expected empty username, got '%s'", username)
207-
}
208-
if password != "pass1" {
209-
t.Fatalf("expected password 'pass1', got '%s'", password)
210-
}
211-
})
249+
for _, tt := range tests {
250+
t.Run(tt.name, func(t *testing.T) {
251+
creds := NewBasicCredentials(tt.username, tt.password)
252+
253+
user, pass := creds.BasicAuth()
254+
if user != tt.expectedUser {
255+
t.Errorf("BasicAuth() username = %q; want %q", user, tt.expectedUser)
256+
}
257+
if pass != tt.expectedPass {
258+
t.Errorf("BasicAuth() password = %q; want %q", pass, tt.expectedPass)
259+
}
260+
261+
raw := creds.RawCredentials()
262+
if raw != tt.expectedRaw {
263+
t.Errorf("RawCredentials() = %q; want %q", raw, tt.expectedRaw)
264+
}
265+
})
266+
}
212267
}
213268

214269
func TestReAuthCredentialsListener(t *testing.T) {

command.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3584,15 +3584,14 @@ func (c *cmdsInfoCache) Get(ctx context.Context) (map[string]*CommandInfo, error
35843584
return err
35853585
}
35863586

3587+
lowerCmds := make(map[string]*CommandInfo, len(cmds))
3588+
35873589
// Extensions have cmd names in upper case. Convert them to lower case.
35883590
for k, v := range cmds {
3589-
lower := internal.ToLower(k)
3590-
if lower != k {
3591-
cmds[lower] = v
3592-
}
3591+
lowerCmds[internal.ToLower(k)] = v
35933592
}
35943593

3595-
c.cmds = cmds
3594+
c.cmds = lowerCmds
35963595
return nil
35973596
})
35983597
return c.cmds, err

commands_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ var _ = Describe("Commands", func() {
460460
}
461461

462462
// read the defaults to set them back later
463-
for setting, _ := range expected {
463+
for setting := range expected {
464464
val, err := client.ConfigGet(ctx, setting).Result()
465465
Expect(err).NotTo(HaveOccurred())
466466
defaults[setting] = val[setting]

error.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ var ErrPoolExhausted = pool.ErrPoolExhausted
2222
// ErrPoolTimeout timed out waiting to get a connection from the connection pool.
2323
var ErrPoolTimeout = pool.ErrPoolTimeout
2424

25+
// ErrCrossSlot is returned when keys are used in the same Redis command and
26+
// the keys are not in the same hash slot. This error is returned by Redis
27+
// Cluster and will be returned by the client when TxPipeline or TxPipelined
28+
// is used on a ClusterClient with keys in different slots.
29+
var ErrCrossSlot = proto.RedisError("CROSSSLOT Keys in request don't hash to the same slot")
30+
2531
// HasErrorPrefix checks if the err is a Redis error and the message contains a prefix.
2632
func HasErrorPrefix(err error, prefix string) bool {
2733
var rErr Error

example/del-keys-without-ttl/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
replace github.com/redis/go-redis/v9 => ../..
66

77
require (
8-
github.com/redis/go-redis/v9 v9.9.0
8+
github.com/redis/go-redis/v9 v9.10.0
99
go.uber.org/zap v1.24.0
1010
)
1111

example/hll/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.9.0
7+
require github.com/redis/go-redis/v9 v9.10.0
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.3.0 // indirect

0 commit comments

Comments
 (0)