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

hertz_gorm demo无法运行 #168

Open
yibajianghudao opened this issue Jan 27, 2025 · 3 comments
Open

hertz_gorm demo无法运行 #168

yibajianghudao opened this issue Jan 27, 2025 · 3 comments

Comments

@yibajianghudao
Copy link

Describe the bug

运行go build -o hertz_gorm之后报错:

# github.com/cloudwego/hertz-examples/bizdemo/hertz_gorm
link: github.com/bytedance/sonic/ast: invalid reference to encoding/json.safeSet

To Reproduce

Steps to reproduce the behavior:

  1. 克隆hertz-examples仓库
  2. cd /hertz-examples/bizdemo/hertz_gorm/
  3. docker-compose up
  4. go build -o hertz_gorm

Expected behavior

正常编译

Hertz version:

最新版

Additional context

可能是sonic的版本问题,参考

go.sum部分信息:

github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.8.1 h1:NqAHCaGaTzro0xMmnTCLUyRlbEP6r8MCA1cJUrH3Pu4=
github.com/bytedance/sonic v1.8.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=

我是新手,不知道怎么找是哪个包引用了sonic.

@yibajianghudao
Copy link
Author

运行go get github.com/bytedance/sonic@latest可以临时解决

@GuangmingLuo
Copy link
Member

升级hertz版本或者sonic版本即可解决问题

@GuangmingLuo
Copy link
Member

有兴趣可以提交下PR更新 hertz_gorm 的 go.mod 文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants