Skip to content

Commit 555dacb

Browse files
committed
Another cosmetic change
1 parent ab225dc commit 555dacb

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

cli/firmware/flash.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,13 @@ func runFlash(cmd *cobra.Command, args []string) {
7575
uploadToolDir := common.DownloadRequiredToolsForBoard(packageIndex, board)
7676

7777
// Get module name if not specified
78-
moduleName := ""
78+
moduleName := board.Module
7979
moduleVersion := ""
80-
if module == "" {
81-
moduleName = board.Module
82-
} else {
83-
moduleSplit := strings.Split(module, "@")
84-
if len(moduleSplit) == 2 {
85-
moduleName = moduleSplit[0]
86-
moduleVersion = moduleSplit[1]
87-
} else {
88-
moduleName = module
80+
if module != "" {
81+
split := strings.SplitN(module, "@", 2)
82+
moduleName = split[0]
83+
if len(split) == 2 {
84+
moduleVersion = split[1]
8985
}
9086
}
9187
// Normalize module name

0 commit comments

Comments
 (0)