Skip to content

Commit 3ed768a

Browse files
yj-yooMandssS
authored andcommitted
refectoring: Delete unnecessary code
Signed-off-by: Youngjun <yj.yoo@okestro.com>
1 parent abae755 commit 3ed768a

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

cli/cmd/check_java.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (djc *CheckJavaCommand) checkJdk() error {
143143
}
144144
javaResult := response.Result.(string)
145145

146-
jdkVersion, err := djc.getJdkVersionFromJavaVer(string(javaResult))
146+
jdkVersion, err := djc.getJdkVersionFromJavaVer(javaResult)
147147
if err != nil {
148148
return fmt.Errorf("check java jdk version failed! err: %s", err.Error())
149149
}

cli/cmd/check_os.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (doc *CheckOsCommand) execOperatorCmd(checkExecCmd *CheckExecCmd) {
186186

187187
if len(cmdArr) != 2 {
188188
fmt.Printf("[failed] %s, failed! error: yaml faile is wrong \n", execResult.cmd)
189-
execResult.info = fmt.Sprintf("yaml faile is wrong")
189+
execResult.info = "yaml faile is wrong"
190190
execResult.result = "failed"
191191
continue
192192
}
@@ -361,7 +361,7 @@ func (doc *CheckOsCommand) actionRunEFunc(target, scope string, actionCommand *a
361361
if !ok || value == "" {
362362
response.Code = spec.ParameterLess.Code
363363
response.Success = false
364-
response.Err = fmt.Sprintf("[failed] check failed! err: less required parameter!")
364+
response.Err = "[failed] check failed! err: less required parameter!"
365365
cmd.Println(response.Print())
366366
return nil
367367
}

cli/cmd/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (cc *CreateCommand) actionRunEFunc(target, scope string, actionCommand *act
201201
time.Sleep(time.Millisecond * 100)
202202
log.Debugf(ctx, "result: %v", response.Result)
203203
if response.Result == nil {
204-
errMsg := fmt.Sprintf("chaos_os process not found, please check chaosblade log")
204+
errMsg := "chaos_os process not found, please check chaosblade log"
205205
checkError(GetDS().UpdateExperimentModelByUid(model.Uid, Error, errMsg))
206206
response.Err = errMsg
207207
} else {

cli/cmd/server_stop.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (ssc *StopServerCommand) run(cmd *cobra.Command, args []string) error {
4848
if err != nil {
4949
return spec.ResponseFailWithFlags(spec.OsCmdExecFailed, startServerKey, err)
5050
}
51-
if pids == nil || len(pids) == 0 {
51+
if len(pids) == 0 {
5252
log.Infof(context.Background(), "the blade server process not found, so return success for stop operation")
5353
//log.Info("the blade server process not found, so return success for stop operation")
5454
cmd.Println(spec.ReturnSuccess("success").Print())

cli/cmd/status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (sc *StatusCommand) Init() {
6969

7070
}
7171
func (sc *StatusCommand) runStatus(command *cobra.Command, args []string) error {
72-
var uid = ""
72+
var uid string
7373
if len(args) > 0 {
7474
uid = args[0]
7575
} else {

0 commit comments

Comments
 (0)