Skip to content

Commit

Permalink
optimize code (#301)
Browse files Browse the repository at this point in the history
* optimize code
  • Loading branch information
tylitianrui authored Sep 11, 2021
1 parent 967abf1 commit a4db9f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.idea
.data
.data
10 changes: 4 additions & 6 deletions clients/config_client/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,20 +202,18 @@ func (client *ConfigClient) getConfigInner(param vo.ConfigParam) (content string
func (client *ConfigClient) PublishConfig(param vo.ConfigParam) (published bool, err error) {
if len(param.DataId) <= 0 {
err = errors.New("[client.PublishConfig] param.dataId can not be empty")
return
}
if len(param.Content) <= 0 {
err = errors.New("[client.PublishConfig] param.content can not be empty")
return
}

if len(param.Group) <= 0 {
param.Group = constant.DEFAULT_GROUP
}
if err != nil {
return false, err
}
param.Content, err = client.encrypt(param.DataId, param.Content)
if err != nil {
return false, err
if param.Content, err = client.encrypt(param.DataId, param.Content); err != nil {
return
}

clientConfig, _ := client.GetClientConfig()
Expand Down

0 comments on commit a4db9f2

Please sign in to comment.