fix: 修复 golangci-lint errcheck 错误
This commit is contained in:
@@ -188,7 +188,7 @@ func (api WebsiteApi) GroupsSetEndpoint(c echo.Context) error {
|
||||
return err
|
||||
}
|
||||
ctx := context.TODO()
|
||||
repository.WebsiteGroupRepository.DeleteAll(ctx)
|
||||
_ = repository.WebsiteGroupRepository.DeleteAll(ctx)
|
||||
for i, item := range req {
|
||||
name := ""
|
||||
if v, ok := item["name"].(string); ok {
|
||||
@@ -203,7 +203,7 @@ func (api WebsiteApi) GroupsSetEndpoint(c echo.Context) error {
|
||||
Sort: i,
|
||||
Created: common.NowJsonTime(),
|
||||
}
|
||||
repository.WebsiteGroupRepository.Create(ctx, &group)
|
||||
_ = repository.WebsiteGroupRepository.Create(ctx, &group)
|
||||
if subChildren, ok := item["children"].([]interface{}); ok {
|
||||
saveWebsiteGroupChildren(ctx, subChildren, group.ID)
|
||||
}
|
||||
@@ -230,7 +230,7 @@ func saveWebsiteGroupChildren(ctx context.Context, children []interface{}, paren
|
||||
Sort: i,
|
||||
Created: common.NowJsonTime(),
|
||||
}
|
||||
repository.WebsiteGroupRepository.Create(ctx, &group)
|
||||
_ = repository.WebsiteGroupRepository.Create(ctx, &group)
|
||||
if subChildren, ok := m["children"].([]interface{}); ok {
|
||||
saveWebsiteGroupChildren(ctx, subChildren, group.ID)
|
||||
}
|
||||
@@ -269,7 +269,7 @@ func (api WebsiteApi) ChangeGroupEndpoint(c echo.Context) error {
|
||||
continue
|
||||
}
|
||||
website.GroupId = req.GroupId
|
||||
repository.WebsiteRepository.UpdateById(context.TODO(), &website, websiteId)
|
||||
_ = repository.WebsiteRepository.UpdateById(context.TODO(), &website, websiteId)
|
||||
}
|
||||
return Success(c, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user