Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade go-redis to v9(latest release version) #661

Closed
wants to merge 13 commits into from

Conversation

GargantuaX
Copy link
Contributor

因为社区内很多库已经转向V9,是时候升级了,否则用户将同时维护v8,v9两个client

@@ -5,10 +5,10 @@ go 1.16
require (
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d
github.com/fatih/structs v1.1.0
github.com/go-redis/redis/v8 v8.11.5
github.com/redis/go-redis/v9 v9.0.2
Copy link
Collaborator

@houseme houseme Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go-redis 需要的版本是 go 1.18,需要考虑一下 wechat go version的升级

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go-redis v9已移交给redis官方,现在在github.com/redis/ 下,有redis官方背书,未来毫无疑问会大规模流行。
关于go version,go-redis表示只支持最近2个go版本,考虑到go的版本升级代价极小,建议积极支持新版本。
redis/go-redis#2323 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go-redis v9已移交给redis官方,现在在github.com/redis/ 下,有redis官方背书,未来毫无疑问会大规模流行。 关于go version,go-redis表示只支持最近2个go版本,考虑到go的版本升级代价极小,建议积极支持新版本。 redis/go-redis#2323 (comment)

那就修改一下版本

Copy link
Collaborator

@houseme houseme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix ci

@houseme houseme requested a review from silenceper March 30, 2023 10:53
@houseme
Copy link
Collaborator

houseme commented Mar 30, 2023

还有go.mod 中的go version 需要更新

@GargantuaX
Copy link
Contributor Author

还有go.mod 中的go version 需要更新

fix done

@houseme
Copy link
Collaborator

houseme commented Mar 30, 2023

执行一下 go mod tidy

@GargantuaX
Copy link
Contributor Author

执行一下 go mod tidy

执行过了

@houseme
Copy link
Collaborator

houseme commented Mar 30, 2023

执行一下 go mod tidy

执行过了

Run go test -v -race ./...
go: github.com/redis/go-redis/v9@v9.0.2 requires
	github.com/bsm/ginkgo/v2@v2.5.0: missing go.sum entry; to add it:
	go mod download github.com/bsm/ginkgo/v2
Error: Process completed with exit code 1.

go.sum 中缺失github.com/bsm/ginkgo/v2@v2.5.0

@GargantuaX
Copy link
Contributor Author

又试了一下,确实执行过,文件无变化。1.16,1.17,1.18报错信息并不相同,考虑版本引起的差异?

@houseme
Copy link
Collaborator

houseme commented Mar 31, 2023

又试了一下,确实执行过,文件无变化。1.16,1.17,1.18报错信息并不相同,考虑版本引起的差异?

go-version: [1.16.x,1.17.x,1.18.x]
辛苦修改为 1.18.x

go: ["1.16", "1.17", "1.18"]

修改为 "1.18.x","1.19.x","1.20.x"

@silenceper
Copy link
Owner

冲突麻烦修正一下

@GargantuaX
Copy link
Contributor Author

conflict fix done

@GargantuaX
Copy link
Contributor Author

Please review the code, thx

@houseme
Copy link
Collaborator

houseme commented May 11, 2023

Please review the code, thx

升级之后需要考虑一部分低版本的用户的使用,是不是来一个新的分支并行发版

@silenceper
Copy link
Owner

@houseme 这个通过tag来区分吧;引用不同的版本

.github/workflows/go.yml Outdated Show resolved Hide resolved
@GargantuaX
Copy link
Contributor Author

建议撤销此pr。更好的做法是使用者自行实现Cache接口,使用者可以选用任意版本/任意设置redis实现,本包中的redis cache实现仅作为一个参考。

@houseme
Copy link
Collaborator

houseme commented Aug 25, 2023

@GargantuaX 如果急需使用,可以 这样获取代码 #6b764e9

go get -u -v github.com/silenceper/wechat/v2@26b0aac

@GargantuaX
Copy link
Contributor Author

@GargantuaX 如果急需使用,可以 这样获取代码 #6b764e9

go get -u -v github.com/silenceper/wechat/v2@26b0aac

谢谢。不过我换了使用方式,本地实现了一个Cache传入到wechat,所以不依赖此代码了

@houseme
Copy link
Collaborator

houseme commented Aug 25, 2023

建议撤销此pr。更好的做法是使用者自行实现Cache接口,使用者可以选用任意版本/任意设置redis实现,本包中的redis cache实现仅作为一个参考。

采纳,以及该 pr 关闭

@houseme houseme closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants