从君华

Results 8 comments of 从君华

> 老铁,我也遇到这样的问题,你是怎么解决的 将 `unique` 换成 `uniqueIndex` 。

```bash $ go version go version go1.20.1 darwin/amd64 ```

> same here, did you found a solution? also the linked issues did not work for me :/ pull 👉 https://github.com/congjunhua/go-callvis.git

> Consider using [gvm](https://github.com/moovweb/gvm) and installing one of the previous go versions. For example: > > ``` > ❯ gvm install go1.18.10 > ❯ gvm use go1.18.10 > ❯ gvm...

> Waiting for a fix, I have the same problem https://github.com/congjunhua/go-callvis

> So you need to conditionally populate the id in the hook. > > ```go > if r.ID != 0 { > r.ID = uint(time.Now().Unix()) > } > ``` 现在确实是通过在钩子中判断`ID`是否为空来决定是否执行`ID`填充,但本质上还是没有解决钩子函数一定会被执行的问题,而这个执行是不被期待的,感觉这徒增了心智负担。...

将`time.Time`改为`string`可以规避报错,虽然不合理且徒增了类型转化的步骤,但暂时也只能这样了。 望早日修复。

> You can try `parseTime=True` in your DSN, just like `gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local` 用了,但不起作用。