hertz-examples
hertz-examples copied to clipboard
hertz_gorm demo无法运行
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:
- 克隆hertz-examples仓库
- cd /hertz-examples/bizdemo/hertz_gorm/
- docker-compose up
- 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.
运行go get github.com/bytedance/sonic@latest可以临时解决
升级hertz版本或者sonic版本即可解决问题
有兴趣可以提交下PR更新 hertz_gorm 的 go.mod 文件