generated from msb_47094/GinChat
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
444 B
31 lines
444 B
10 months ago
|
/**
|
||
|
* @Auth:ShenZ
|
||
|
* @Description:
|
||
|
* @CreateDate:2022/06/15 17:27:15
|
||
|
*/
|
||
|
package mq
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
"ginchat/utils"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
var ctx context.Context
|
||
|
|
||
|
func init() {
|
||
|
ctx = context.Background()
|
||
|
}
|
||
|
|
||
|
// TestPublish 测试发布消息到redis
|
||
|
func TestPublish(t *testing.T) {
|
||
|
msg := "当前时间: " + time.Now().Format("15:04:05")
|
||
|
err := utils.Publish(ctx, utils.PublishKey, msg)
|
||
|
if err != nil {
|
||
|
|
||
|
fmt.Println(err)
|
||
|
}
|
||
|
}
|