Skip to content

Commit 3080477

Browse files
committed
PUBLISHString drop [leftover]
1 parent bf758de commit 3080477

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pubsub.go

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ func (c *Client[Key, Value]) PUBLISH(channel Key, message Value) (clientCount in
1616
return c.commandInteger(requestWith2Strings("*3\r\n$7\r\nPUBLISH\r\n$", channel, message))
1717
}
1818

19-
// PUBLISHString executes <https://redis.io/commands/publish>.
20-
func (c *Client[Key, Value]) PUBLISHString(channel Key, message Value) (clientCount int64, err error) {
21-
return c.commandInteger(requestWith2Strings("*3\r\n$7\r\nPUBLISH\r\n$", channel, message))
22-
}
23-
2419
// ListenerConfig defines a Listener setup.
2520
type ListenerConfig struct {
2621
// Func is the callback interface for both push messages and error

pubsub_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestSubscribe(t *testing.T) {
113113
}
114114

115115
// follow up with second message
116-
clientN, err := testClient.PUBLISHString(channel, message2)
116+
clientN, err := testClient.PUBLISH(channel, message2)
117117
if err != nil {
118118
t.Error("followup publish error:", err)
119119
return
@@ -166,7 +166,7 @@ func TestUnsubscribe(t *testing.T) {
166166
l.UNSUBSCRIBE(channel)
167167
awaitExecution()
168168

169-
clientCount, err := testClient.PUBLISHString(channel, "ping")
169+
clientCount, err := testClient.PUBLISH(channel, "ping")
170170
if err != nil {
171171
t.Error("publish got error:", err)
172172
} else if clientCount != 0 {
@@ -184,7 +184,7 @@ func TestUnsubscribeRace(t *testing.T) {
184184
l.UNSUBSCRIBE(channel)
185185
awaitExecution()
186186

187-
clientCount, err := testClient.PUBLISHString(channel, "ping")
187+
clientCount, err := testClient.PUBLISH(channel, "ping")
188188
if err != nil {
189189
t.Error("publish got error:", err)
190190
} else if clientCount != 0 {
@@ -232,12 +232,12 @@ func TestListenerClose(t *testing.T) {
232232
// don't await execution
233233
l.Close()
234234

235-
if n, err := testClient.PUBLISHString(channel1, "ping"); err != nil {
235+
if n, err := testClient.PUBLISH(channel1, "ping"); err != nil {
236236
t.Error("publish error:", err)
237237
} else if n != 0 {
238238
t.Errorf("publish got %d clients, want 0", n)
239239
}
240-
if n, err := testClient.PUBLISHString(channel2, "ping"); err != nil {
240+
if n, err := testClient.PUBLISH(channel2, "ping"); err != nil {
241241
t.Error("publish subscribe error:", err)
242242
} else if n != 0 {
243243
t.Errorf("publish subscribe got %d clients, want 0", n)

0 commit comments

Comments
 (0)