Skip to content

Commit

Permalink
fix: golangci-lint规范修复
Browse files Browse the repository at this point in the history
  • Loading branch information
LidolLxf committed Sep 19, 2024
1 parent 838c3ca commit 8c13ff0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (da *DeleteAction) setResp(code uint32, msg string) {
da.resp.Result = (code == common.BcsErrClusterManagerSuccess)
}

// nolint result error is always nil
func (da *DeleteAction) getRelativeResource() error {
cluster, err := da.model.GetCluster(da.ctx, da.req.ClusterID)
if err == nil {
Expand Down Expand Up @@ -86,7 +87,7 @@ func (da *DeleteAction) Handle(
return
}
da.resp.Data = deleteOption
if err := da.model.DeleteAutoScalingOption(da.ctx, da.req.ClusterID); err != nil {
if err = da.model.DeleteAutoScalingOption(da.ctx, da.req.ClusterID); err != nil {
da.setResp(common.BcsErrClusterManagerDBOperation, err.Error())
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func (ua *UpdateNodeAction) Handle(ctx context.Context, req *cmproto.UpdateNodeR
ResourceType: common.Cluster.String(),
ResourceID: "",
TaskID: "",
Message: fmt.Sprintf("更新node信息"),
Message: "更新node信息",
OpUser: auth.GetUserFromCtx(ua.ctx),
CreateTime: time.Now().Format(time.RFC3339),
ClusterID: ua.req.ClusterID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (ua *RecordNodeDataAction) recordNodes() error { // nolint
ResourceType: common.Cluster.String(),
ResourceID: clusterID,
TaskID: "",
Message: fmt.Sprintf("录入节点详情信息"),
Message: "录入节点详情信息",
OpUser: auth.GetUserFromCtx(ua.ctx),
CreateTime: time.Now().Format(time.RFC3339),
ClusterID: cluster.ClusterID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (ua *UpdateAction) Handle(
blog.Errorf("find nodeTemplate %s failed when pre-update checking, err %s", req.NodeTemplateID, err.Error())
return
}
if err := ua.updateNodeTemplate(destNodeTemplate); err != nil {
if err = ua.updateNodeTemplate(destNodeTemplate); err != nil {
ua.setResp(common.BcsErrClusterManagerDBOperation, err.Error())
return
}
Expand Down

0 comments on commit 8c13ff0

Please sign in to comment.