feat: 添加 Go 内存分配示例并整理笔记
拆分 Go 第三方库笔记并更新索引。 新增 Gitleaks 使用说明,清理过时笔记。
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# goverter
|
||||
|
||||
[GitHub地址](https://github.com/jmattheis/goverter)
|
||||
|
||||
类型转换器,可以用于类型的转换,比如下面的代码
|
||||
|
||||
```go
|
||||
func (l *CreatePopupLogic) CreatePopup(in *backgroundrpcmodel.ResPopup) (*backgroundrpcmodel.ResResult, error) {
|
||||
_, err := l.svcCtx.PopupModel.Insert(l.ctx, u.Convert.SysPopupR2S(in.Info))
|
||||
if err != nil {
|
||||
return nil, rerr.NewFromSQL(err)
|
||||
}
|
||||
return &backgroundrpcmodel.ResResult{
|
||||
Result: true,
|
||||
}, nil
|
||||
}
|
||||
```
|
||||
|
||||
使用
|
||||
|
||||
```
|
||||
goverter gen .
|
||||
```
|
||||
Reference in New Issue
Block a user