@@ -67,30 +67,30 @@ func ParseReference(arg string) (*Reference, error) {
67
67
return nil , fmt .Errorf (tr ("invalid empty core argument" ))
68
68
}
69
69
70
- if toks := strings .SplitN (arg , "@" , 2 ); toks [0 ] == "" {
70
+ toks := strings .SplitN (arg , "@" , 2 )
71
+ if toks [0 ] == "" {
71
72
return nil , fmt .Errorf (tr ("invalid empty core reference '%s'" ), arg )
72
- } else {
73
- ret .PackageName = toks [0 ]
74
- if len (toks ) > 1 {
75
- if toks [1 ] == "" {
76
- return nil , fmt .Errorf (tr ("invalid empty core version: '%s'" ), arg )
77
- }
78
- ret .Version = toks [1 ]
73
+ }
74
+ ret .PackageName = toks [0 ]
75
+ if len (toks ) > 1 {
76
+ if toks [1 ] == "" {
77
+ return nil , fmt .Errorf (tr ("invalid empty core version: '%s'" ), arg )
79
78
}
79
+ ret .Version = toks [1 ]
80
80
}
81
81
82
- if toks := strings .Split (ret .PackageName , ":" ); len (toks ) != 2 {
82
+ toks = strings .Split (ret .PackageName , ":" )
83
+ if len (toks ) != 2 {
83
84
return nil , fmt .Errorf (tr ("invalid item %s" ), arg )
84
- } else {
85
- if toks [0 ] == "" {
86
- return nil , fmt .Errorf (tr ("invalid empty core name '%s'" ), arg )
87
- }
88
- ret .PackageName = toks [0 ]
89
- if toks [1 ] == "" {
90
- return nil , fmt .Errorf (tr ("invalid empty core architecture '%s'" ), arg )
91
- }
92
- ret .Architecture = toks [1 ]
93
85
}
86
+ if toks [0 ] == "" {
87
+ return nil , fmt .Errorf (tr ("invalid empty core name '%s'" ), arg )
88
+ }
89
+ if toks [1 ] == "" {
90
+ return nil , fmt .Errorf (tr ("invalid empty core architecture '%s'" ), arg )
91
+ }
92
+ ret .PackageName = toks [0 ]
93
+ ret .Architecture = toks [1 ]
94
94
95
95
// Now that we have the required informations in `ret` we can
96
96
// try to use core.PlatformList to optimize what the user typed
@@ -126,7 +126,7 @@ func ParseReference(arg string) (*Reference, error) {
126
126
if len (foundPlatforms ) > 1 {
127
127
return nil , & arduino.MultiplePlatformsError {Platforms : foundPlatforms , UserPlatform : arg }
128
128
}
129
- toks : = strings .Split (foundPlatforms [0 ], ":" )
129
+ toks = strings .Split (foundPlatforms [0 ], ":" )
130
130
ret .PackageName = toks [0 ]
131
131
ret .Architecture = toks [1 ]
132
132
return ret , nil
0 commit comments