File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -3,26 +3,24 @@ package checkfunctions
3
3
// The check functions for sketches.
4
4
5
5
import (
6
+ "strings"
7
+
6
8
"github.com/arduino/arduino-check/check/checkdata"
7
9
"github.com/arduino/arduino-check/check/checkresult"
8
10
)
9
11
10
12
func PdeSketchExtension () (result checkresult.Type , output string ) {
11
13
directoryListing , _ := checkdata .ProjectPath ().ReadDir ()
12
14
directoryListing .FilterOutDirs ()
13
- pdeSketches := ""
15
+ pdeSketches := [] string {}
14
16
for _ , filePath := range directoryListing {
15
17
if filePath .Ext () == ".pde" {
16
- if pdeSketches == "" {
17
- pdeSketches = filePath .Base ()
18
- } else {
19
- pdeSketches += ", " + filePath .Base ()
20
- }
18
+ pdeSketches = append (pdeSketches , filePath .Base ())
21
19
}
22
20
}
23
21
24
- if pdeSketches != "" {
25
- return checkresult .Fail , pdeSketches
22
+ if len ( pdeSketches ) > 0 {
23
+ return checkresult .Fail , strings . Join ( pdeSketches , ", " )
26
24
}
27
25
28
26
return checkresult .Pass , ""
You can’t perform that action at this time.
0 commit comments