Skip to content

Commit 7811d69

Browse files
committed
remove unnucessary break stmt
Signed-off-by: Tin Lai <[email protected]>
1 parent 4c3aa31 commit 7811d69

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

pkg/config/host.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,10 @@ func (h *Host) Options() OptionsList {
259259
if fieldVal := field.String(); fieldVal == "" {
260260
options = append(options, Option{Name: fieldName, Value: fieldVal})
261261
}
262-
break
263262
case reflect.Int:
264263
if fieldVal := field.Int(); fieldVal != 0 {
265264
options = append(options, Option{Name: fieldName, Value: fmt.Sprintf("%d", fieldVal)})
266265
}
267-
break
268266
case reflect.TypeOf(composeyaml.Stringorslice(nil)).Kind():
269267
fieldVal := field.Interface().(composeyaml.Stringorslice)
270268

@@ -279,7 +277,6 @@ func (h *Host) Options() OptionsList {
279277
} else {
280278
panic(fmt.Sprintf("Undefined Range type for field '%s'.\nIt must contains either of the following value: [ joinByComma, perLine ]", fieldName))
281279
}
282-
break
283280
default:
284281
panic(fmt.Sprintf("Unimplemented datatype '%s' for field '%s'", field.Type(), fieldName))
285282
}
@@ -350,22 +347,19 @@ func (h *Host) ApplyDefaults(defaults *Host) {
350347
fieldVal = defaultsReflecet.FieldByName(fieldName).String()
351348
}
352349
field.SetString(utils.ExpandField(fieldVal))
353-
break
354350
case reflect.Int:
355351
fieldVal := field.Int()
356352

357353
if fieldVal == 0 {
358354
field.SetInt(defaultsReflecet.FieldByName(fieldName).Int())
359355
}
360-
break
361356
case reflect.TypeOf(composeyaml.Stringorslice(nil)).Kind():
362357
fieldVal := field.Interface().(composeyaml.Stringorslice)
363358

364359
if len(fieldVal) == 0 {
365360
fieldVal = defaultsReflecet.FieldByName(fieldName).Interface().(composeyaml.Stringorslice)
366361
}
367362
field.Set(reflect.ValueOf(utils.ExpandSliceField(fieldVal)).Convert(field.Type()))
368-
break
369363
default:
370364
panic(fmt.Sprintf("Unimplemented datatype '%s' for field '%s'", field.Type(), fieldName))
371365
}
@@ -484,13 +478,11 @@ func (h *Host) WriteSSHConfigTo(w io.Writer) error {
484478
if fieldVal != "" {
485479
_, _ = fmt.Fprintf(w, " %s %s\n", fieldName, fieldVal)
486480
}
487-
break
488481
case reflect.Int:
489482
fieldVal := field.Int()
490483
if fieldVal != 0 {
491484
_, _ = fmt.Fprintf(w, " %s %d\n", fieldName, fieldVal)
492485
}
493-
break
494486
case reflect.TypeOf(composeyaml.Stringorslice(nil)).Kind():
495487
fieldVal := field.Interface().(composeyaml.Stringorslice)
496488

@@ -505,7 +497,6 @@ func (h *Host) WriteSSHConfigTo(w io.Writer) error {
505497
} else {
506498
panic(fmt.Sprintf("Undefined Range type for field '%s'.\nIt must contains either of the following value: [ joinByComma, perLine ]", fieldName))
507499
}
508-
break
509500
default:
510501
panic(fmt.Sprintf("Unimplemented datatype '%s' for field '%s'", field.Type(), fieldName))
511502
}

0 commit comments

Comments
 (0)